Unhandled exception at : Access violation writing location 0x00000000.

Hello I have this error,

Trying to read a string and a int from an input file.
I have this ERROR: Unhandled exception at 0x5885e42e (msvcr100d.dll) in ProyectC.exe: 0xC0000005: Access violation writing location 0x00000000.
Last edited on
char pointers are not strings

if you want to have a string... use a string:

1
2
3
4
5
6
#include <string>

//...

//char * item_sale[10];  BAD
std::string item_sale[10];  // good! 
It would have worked if he had actually allocated memory for those char* though. But I agree that strings are better in the context (as well as in most other contexts).
Topic archived. No new replies allowed.