From: anonymous Newsgroups: comp.os.msdos.djgpp Subject: Getline help Date: Mon, 12 Jan 1998 19:58:54 -0800 Organization: PDN/Chatlink Lines: 31 Message-ID: <34BAE67D.5DA1@delanet.com> Reply-To: naga4321 AT delanet DOT com NNTP-Posting-Host: realnews.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I receive a run time error in HEX when I attempt to read a data file consisting of 2 lines with the following code. Any help on proper use of the getline routine would be appreciated. (note: the code extracts the first line of the file without error if I don't use the second getline request to try to get the second line in the file). Please reply to my email address. #include #include int main() { ifstream inFile = "test3.dat"; //test3.dat contains 2 lines for input char * ptr_line1; char * ptr_line2; inFile.getline(ptr_line1,50,'\n'); inFile.getline(ptr_line2,50,'\n'); cout << ptr_line1 << endl; cout << ptr_line2 << endl; return 0; }