473,403 Members | 2,270 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,403 software developers and data experts.

file stream's visibility

first of all accept my apologies for bad English.
(I am not a native English speaker)

I am a 1st year B.Sc CS student.

This is about file handling.
I am writing a program to receive feedbacks from students about ther
professors and then give a tabular output.
This is for whole college.(Actually program was already written by my
friend in Visual Basic-but I need to write it myself in the one and
only one language I currently known-Java and Python study are
progressing)

In my program I used a file handle object as

fstream data;

in the global section.
And I have many functions,and they are called each other within
themselves.

If both of them need the same file to work with.

ie., One function is used to enter some details to the file (In my
program it is a structer of professors-which contains details about
professor).Another is used to verify that that particular professor is
not in the list-to reduce redundancy.

I call the first function and use the global fstream object data to
open a file.

data.open("professor.FBA",ios::in|ios::out|ios::ap p|ios::binary);
//FBA shorts for Feed Back Agent-this is what the name I gave it.
//I think there is no problem for naming the file as *.FBA,Am I?

then receive user input to the structure object which is also global
then before adding it to the file,call the second function with the
structure as argument.note that now file is not closed explicitly.In
the second function too we need the above file "professor.FBA" to work
with.
Now my question is that whether I can use the file with the data
object(which is connected to the file and I never closed it.)
I am a little bit confused, because after the first function become
out of scope the file may be automatically closed,I am not sure :-( .\
Can you experienced people help me?

I need clarification.
I am using file because I don't know how to connect to mySQL or even
access( I am not prefer it because I need my programs works on Linux
too)
Can you give me any reference to this matter( database connectivity)
I am using Dev C++ and Visual C++ 6 and turbo c++. first two are used
very often because I don't know GUI programming.
And in Linux Anjuta IDE.

Arun
[
Atharvan!!!
{333}
<a href="http://chintaadaara.blogspot.com">Chintaadaara</a>
]
Mar 2 '08 #1
0 1160

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

Similar topics

3
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification...
12
by: lawrence | last post by:
The following function correctly makes everything invisible but then fails to turn the one chosen DIV back to visible. I imagine I'm getting the syntax of the variable wrong? I've tried this with...
4
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) {...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
5
by: IcingDeath via DotNetMonster.com | last post by:
I am building this SQL Server database app in which i can store files. In order to display files I want to have the app show the associated icon for the extension of the file that is in the...
4
by: rony_16 | last post by:
Hi, I have a program that connects to a site With WebRequest and WebResponse . The response of this site is a file (csv file). The problem is that the file do not comes as a stream , hi is a part...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
3
Plater
by: Plater | last post by:
I am having a spot of trouble with a little situation. I want to make the submit invisible on a submit so that the user cannot keep clicking on it while the server is receiving the file transfer....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...
0
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...

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.