i have the following code :
thx in advanceCode:void viewall () { agendaview *person; person = person; cout <<person->name<<' '; cout <<person->tel<< ' '; cout <<person->adress<<endl; }
This is a discussion on i need help to initialize this pointer : within the C++ Programming forums, part of the General Programming Boards category; i have the following code : Code: void viewall () { agendaview *person; person = person; cout <<person->name<<' '; cout ...
i have the following code :
thx in advanceCode:void viewall () { agendaview *person; person = person; cout <<person->name<<' '; cout <<person->tel<< ' '; cout <<person->adress<<endl; }
I don't understand what you want to do. If you want to use a pointer to something, you need to either assign it to a different valid pointer, or dynamically allocate memory.Code:void viewall () { agendaview *person; person = person; cout <<person->name<<' '; cout <<person->tel<< ' '; cout <<person->adress<<endl; }
agendaview *person = new agendaview(constructor_arg_1, constructor_arg_2);
// output stuff
delete person;