делаю проект по инфоматике. Длинная арифметика. Под виндой когда-то делал, вот в инсте сказали. Делаю уже не через массив, а через списки
при компиляции вылезают ошибки
mike@nitrogenium:~/longmath$ g++ longint.h longint.cpp main.cpp -o longmath && ./longmath
longint.cpp: In member function ‘int* LongInt::size()’:
longint.cpp:13: error: request for member ‘fdig’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:15: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:16: error: no match for ‘operator!=’ in ‘* p != 0’
longint.cpp:18: error: request for member ‘next’ in ‘p’, which is of non-class type ‘digit*’
longint.cpp:19: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:22: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp: In constructor ‘LongInt::LongInt()’:
longint.cpp:28: error: request for member ‘prev’ in ‘((LongInt*)this)->LongInt::fdig’, which is of non-class type ‘digit*’
longint.cpp:29: error: request for member ‘next’ in ‘((LongInt*)this)->LongInt::fdig’, which is of non-class type ‘digit*’
longint.cpp:30: error: request for member ‘sign’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:31: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:32: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp: In destructor ‘LongInt::~LongInt()’:
longint.cpp:37: error: request for member ‘size’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:39: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:41: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:45: error: request for member ‘fdig’ in ‘this’, which is of non-class type ‘LongInt* const’
longint.cpp:46: error: ISO C++ forbids comparison between pointer and integer
longint.cpp:48: error: request for member ‘next’ in ‘p’, which is of non-class type ‘digit*’
longint.cpp:49: error: request for member ‘prev’ in ‘p’, which is of non-class type ‘digit*’
longint.cpp:52: error: request for member ‘sz’ in ‘this’, which is of non-class type ‘LongInt* const’
Я не понимаю почему, объясните. Программировал давно, возможно я ошибаюсь даже в самом коде.
Код соотв на
http://dev.int1k.ru/projects/longmath/