473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

reading and writting data problem

MJK
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

Nov 21 '08 #1
2 1556
"MJK" wrote:
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.
Nov 21 '08 #2
On Thu, 20 Nov 2008 19:56:05 -0800, MJK wrote:
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
Nov 21 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hayat | last post by:
Hello, I have a column (text datatype) and has to send an email as a text (not attachment) using cdonts. I am reading the data from text column storing in a varchar field and saying cdonts.body...
2
by: fdunne2 | last post by:
How do you write/read a list of siganl points into a c program? each point is on a seperate line.
1
by: mail2atulmehta | last post by:
Hi, I do not know if this is right place for this, but i need some help. I have a text file, whose values are seprated by a delimiter. I want to open this file in excel, ( not import it) . I have...
2
by: John Carnahan | last post by:
I have a problem writing the text from a multi-line textbox to the Sql Server db. If the user sends a vbcrlf (enter key) in the middle of the entered text, the text gets truncated at the vbcrlf...
1
by: itsjyotika | last post by:
Hello Everyone, I need to read data from a CVS file(i created it from micosoft excel) and then need to match it with the one of the date from the command line.If the date is there then it should say...
1
by: maverick7983 | last post by:
Hi, I am engineering student at Rutgers University, I need help in writting a VB.Net program which will read voltage values logged in Excel by a Data Acquisition Card and if the voltage value...
0
by: marinhof | last post by:
hi i need some guidance.. this is the situation im working on web app using Visual studio 2003 working with C# and asp.net the database is managed by sql studio managmnet 2005.. the thing is i...
2
by: Dinesh | last post by:
Hi experts, I am working on SQL Server 2005. Now i have to write a query which will extract some information from a table. My main table is having few columns supose 3 columns. EmpID ...
1
by: miami714 | last post by:
Hi List Members, I am writting a program in Visual Basic and I need to read data from an existing Excel sheet. How can I access the data on Excel? Thank you.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.