|
-
March 31st, 2011, 03:46 AM
#1
[RESOLVED] Cannot get string from a txt file
Hi
I can't read a line using getline() function.using this code generates a runtime error at "iostream" file :
This is my code :
fstream InFile;
InFile.open("c:\\Colors.txt",ios::in);
InFile >> TargetCount;
char *a="12345";
InFile.getline(a,2); // The error is here
This is th error :
Unhandled exception at 0x5f6f3b6c (msvcp100d.dll) in camNew.exe: 0xC0000005: Access violation writing location 0x00b29d74.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|