list - C++ Bool not returning true or false using pointers -


im trying implement list of nodes on own using pointers. ive on class private:

class cj_enters {  private: struct node{   node* next;   node* prev;   int info; };   node* first; node* last; node* actual;  int size;  public: . . }; 

and im trying implement method:

bool cj_enters:: operator==(const cj_enters& b) const{   bool cerca = true;   node* aux = first;   while(aux != null , cerca){       if(!b.conte(aux->info)) // method working , tells if object b has info somewhere of current node info(aux).       {           cerca = false;       }       else aux = aux -> next;   }  return cerca; } 

so don't know why method returning me strange values 244 or when compare 2 of these objects, doesn't matter if same or not.

why that? thanks

if first==null aux==null , call delete aux.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -