473,500 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Handling in C++

Parul Bagadia
188 New Member
This is my first program of file handling...
Here we are supposed to simulate sql language......
This is ofcourse not the complete program; m done only with insertion and select* thing; insert thing is workin properly but in case of select*; nothing gets displayed; but when i checked it in debugger; it was ok. I mean the object of class student has the information but it doesnt get displayed...
May be the information m writtin in file is not actually not gettin written in file. I dont know the actual problem; that's what i want to know.
Now m gettin another error when m done with running it.
The errror comes as:
16 bit MS-DOS subsystem
Turbo C++ IDE
The NTVDM CPU has encountered an illegal instruction CS:8baa IP:2e32 OP:c6 5f 5e 5d c3 choose close to terminate the application.

Tell me sth about this in details.
The compiler m using is of Turbo C++ IDE.
Expand|Select|Wrap|Line Numbers
  1. Full Code (125 lines) removed, please read Posting Guidelines
Jul 28 '08 #1
6 3498
Parul Bagadia
188 New Member
Hi,
When i wrote the same code in Microsoft Visual C++ 6.0. i dont get SQL> as written in the code.. Its always coming after i input the line.. And moreover its comin randomly..
Sometimes its comin 4 times in a row.
Can somebody tell me why is this happening.
Jul 28 '08 #2
Parul Bagadia
188 New Member
In the same code when i wrote
while(enter[i]!=' ')loop
it worked. and when i wrote while(enter[i]!=' ' || enter[i]!='\n')it never used to come out of the loop.... i checked it even by debugger...
I want to know its reason as well.
Jul 28 '08 #3
Savage
1,764 Recognized Expert Top Contributor
In the same code when i wrote
while(enter[i]!=' ')loop
it worked. and when i wrote while(enter[i]!=' ' || enter[i]!='\n')it never used to come out of the loop.... i checked it even by debugger...
I want to know its reason as well.

The reason is that you have used OR instead of AND,so if any of those two expressions succeed it will loop again.Obviously enter[i] can't be ' ' and '\n' in same which is required to exit from the while loop when OR logic is used.
Jul 28 '08 #4
Parul Bagadia
188 New Member
The reason is that you have used OR instead of AND,so if any of those two expressions succeed it will loop again.Obviously enter[i] can't be ' ' and '\n' in same which is required to exit from the while loop when OR logic is used.
Yaeh, actually i got it when i again debugged it but still its not working..
I guess now there can be some problem in gettin inserted in file..
I really dont know why its comin out of while loop of selectall function.,
Jul 30 '08 #5
Parul Bagadia
188 New Member
Hey people, am waitin to know wats wrong with my code...
Jul 31 '08 #6
Laharl
849 Recognized Expert Contributor
Can we have a snippet of the code that's having a problem? Not the whole code, but a bit, say, this while loop you mention.
Aug 1 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

9
3186
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
1
3241
by: Sean W. Quinn | last post by:
Hey folks, I have a question regarding file handling, and the preservation of class structure. I have a class (and I will post snippets of code later in the post) with both primitive data...
5
2274
by: John Douglass | last post by:
I'm fairly new to doing involved file i/o and I came across something weird with a program I'm writing (modifying MIDI data, if it makes any difference). With some input files, when I modify data...
8
26697
by: Gabe Moothart | last post by:
Hi, I'm writing a windows service which interacts with a separate process. Basically, it calls a process which creates a file, and then my service reads that file. The problem is, the external...
14
3859
by: Al Smith | last post by:
I need help in implementing proper error handling. I am trying to upload a file based on the sample code below. The code works well except if the file selected is too big. I do know about the...
1
6436
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
5
4050
by: Digital Puer | last post by:
I fixed a bug today that went against my intuition. I am on Linux. I had a class that fopen'ed some files. When I called delete on these objects, I expected that the files would be closed...
19
4751
by: rmr531 | last post by:
First of all I am very new to c++ so please bear with me. I am trying to create a program that keeps an inventory of items. I am trying to use a struct to store a product name, purchase price,...
5
64575
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called...
5
6787
by: kailashchandra | last post by:
I am trying to upload a file in php,but it gives me error msg please Help me? My Code is like below:- i have one php file named upload.php and i have another html file named upload.html and...
0
7183
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
7235
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...
1
6909
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4614
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3108
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1431
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
317
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.