reading and writting data problem 
November 21st, 2008, 04:05 AM
| | | |
Hello,
I am reading a data file but when I try to print what I already read,
it just prints the first line of the data correctly. From the second
line, it prints 0 for integers and nothing for characters. When I
tried to print the data after every line that I read, it prints
everything OK but when I try to pint after finishing the reading, it
just prints the first line correctly! For allocating the memory, I
used new and to free it, I used delete.
I have to add that sometimes everything goes OK and sometimes I am
facing this problem. Usually it depends how big the entry data is. Any
comments?
MJK | 
November 21st, 2008, 04:05 AM
| | | | re: reading and writting data problem
"MJK" wrote: Quote:
I am reading a data file but when I try to print what I already read,
it just prints the first line of the data correctly. From the second
line, it prints 0 for integers and nothing for characters. When I
tried to print the data after every line that I read, it prints
everything OK but when I try to pint after finishing the reading, it
just prints the first line correctly! For allocating the memory, I
used new and to free it, I used delete.
>
I have to add that sometimes everything goes OK and sometimes I am
facing this problem. Usually it depends how big the entry data is. Any
comments?
| Just a wild guess, but there might be a bug in your code. | 
November 21st, 2008, 10:15 AM
| | | | re: reading and writting data problem
On Thu, 20 Nov 2008 19:56:05 -0800, MJK wrote: Quote:
Hello,
>
I am reading a data file but when I try to print what I already read, it
just prints the first line of the data correctly. From the second line,
it prints 0 for integers and nothing for characters. When I tried to
print the data after every line that I read, it prints everything OK but
when I try to pint after finishing the reading, it just prints the first
line correctly! For allocating the memory, I used new and to free it, I
used delete.
>
I have to add that sometimes everything goes OK and sometimes I am
facing this problem. Usually it depends how big the entry data is. Any
comments?
| Stock answer: there is an error on line 42 of your code. http://www.parashift.com/c++-faq-lit...t.html#faq-5.8
--
Lionel B |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,689 network members.
|