C++ error to set string in struct by pointer -
I have to try setting a string inside of a straight, bellow my code:
straight movieend {string name; }; Int main () {struct movieNode * newMovieNode = (struct menu) * malloc (sizeof (movieNode)); NewMovieNode- & gt; Name = "123"; } After running it, the following message appears:
"Unsupported exception to 0x5EDB11E2 (msvcr110d.dll) in Trabalho.exe: 0xC0000005: Access violation space Writing 0xCDCDCDCD. "
Can anyone help me fix this?
Thank you very much.
You have allocated memory for favorite file , but you do not create it Have done Instead use the new Additionally, the broad type specifier is unnecessary in C ++. MovieVideo * NewMovienNode = New MovieDevD;
Comments
Post a Comment