netbeans - Invalid conversion from 'int' to 'const char*' issue C++ -


the problem occurs in todolist.cpp class file.

todolist.cpp:

todolist::todolist() {     arraysize = 3;     arraydata = 0;     array = new string(arraysize); //error here } todolist::todolist() {     array = new string(todolist.arraysize); //and error here     arraysize = todolist.arraysize;     arraydata = todolist.arraysize; } 

todolist.h:

class todolist { public:     todolist();     todolist(const todolist&);     ~todolist();     void additem(string item);     void listitems();  private:     string* array;     int arraysize;     int arraydata; }; 

if want array of strings, use

array = new string[arraysize]; 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -