There are a total of 744 records in the date file (i.e. a few lines shown below). When I run this (what seems like a very simple file) in the for loop with the counter initilized at 0 to 744 (the total number of records), I only get the records from i= 646 to 744 sent to the console..when I run the counter from 0 to 100, i get the records from 1 to 99...
I've placed cout lines before (and in) the for loop and the counter seems to run fine as long as start at i= 0 to 99 or less but i need to read ALL 744 records. Do I have a memory problem? Why would he counter be changing?.
Can anybody suggest what might be going on?
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
string line;
ifstream myfile ("Data_in2.txt");
Where is cnt defined?
How are you viewing the results? It's possible that your command prompt is just running out of screen space and clearing the oldest lines printed as it runs out of room. If you think that's the case try saving the output to file...
uggg...I can't believe I was that stupid...yes, it was just a matter of the limitation of the screen to display everything...Feeling like such a dummy...Thank you for your help !!!!