delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/19/21:33:59

Message-Id: <3.0.6.32.19981119183246.007a9410@tenforward.com>
X-Sender: sw AT tenforward DOT com
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Thu, 19 Nov 1998 18:32:46 -0800
To: djgpp AT delorie DOT com
From: Jeff Johnson <sw AT tenforward DOT com>
Subject: Line Checking..
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

How Do I Chech To See How Mine Lines (Up/Down) A File Is?

Like, say,

--out.dat--
1
2
3
4
----------

and i want my prog to tell me that there are 4 lines in that file, how do i
do that??
here's what i came up with, but it doesn't work..

/*------------snip-------------*/

out_fileR.open("out.dat");
cout << "Checking For File Lines.." << endl;

while (numba != '\n')
{
out_fileR >> numba;
line++;
}

out_fileR.close();
cout << "Printing Out Detected File Lines.." << endl;
out_fileR.open("out.dat");
while (numbal != line)
{
out_fileR >> oute;
cout << oute << endl;
numbal++;
}

/*---------snip--------*/




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019