Re: C++ Problem
Re: C++ Problem
- Subject: Re: C++ Problem
- From: Shawn Erickson <email@hidden>
- Date: Wed, 20 Sep 2006 20:10:23 -0700
On Sep 20, 2006, at 7:34 PM, Kevin McEnhill wrote: char *buff; // int bob;
ifstream inputfile( argv[1], ios::in );
while( inputfile ) { inputfile.getline( buff, 256 ); cout << buff << endl; }
// bob = 5; // cout << bob << endl;
return 0; }
The "char *buff" is your problem. The getline function expects that you have passed it a pointer to a buffer 256 char in length but you passed it an uninitialized pointer (to some random place.. likely unallocated/invalid memory).
Review the following...
Note this is a C level conceptual issue and not related to the compiler or C++.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >C++ Problem (From: "Kevin McEnhill" <email@hidden>) |