I am doing a project for a programming subject. They ask to save a project in a linked list. Here you have my Struct:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
typedefstruct dados {
int ID;
string title;
char institution[150];
char investigator[150];
string keywords[5];
float money;
struct dados *next; //pointer to next nodule
}No;
This is the 2nd phase of the project, the first one was using a simple array of structs, but this phase they want the same but with a linked list.
I have a function that I use to insert data in a struct. The function ask for an input and I save the data in the struct.
To save a string for title in the first phase I was using this:
getline(cin, no.title);
I want to do the same for the second phase and I did:
getline(cin, no->title);
But it gives this error:
Unhandled exception at 0x00E14E96 in Aplicacao.exe: 0xC0000005: Access violation writing location 0xCDCDCDCD.