Help me i want to store data of this program to a text file. my compiler is Dev C++ . Data code for text file is in bold form
::Full code deleted, please post only the relevant text and errors::
3 1448
Just create a file and use either the write or << methods to get your data to the file. Moderate research will solve your problem.
BTW: You should be using <iostream> and not <iostream.h>. iostream.h was pre-ANS C++ prior to 1998.
Help me i want to store data of this program to a text file. my compiler is Dev C++ . Data code for text file is in bold form
::::
Need code to write this data in a text file - void a::show()
-
{
-
int n;
-
char number[5];
-
cout<<"Enter bus no: ";
-
cin>>number;
-
for(n=0;n<=p;n++)
-
{
-
if(strcmp(bus[n].busn,number)==0)
-
break;
-
}
-
while (n<=p)
-
{
-
vline('*');
-
cout<<" Bus no: \t"<<bus[n].busn
-
<<"\n Driver: \t"<<bus[n].driver<<"\t\t Arrival time:\t"
-
<<bus[n].arrival<<"\t Departure time:\t"<<bus[n].depart
-
<<"\n From:\t\t"<<bus[n].from<<"\t\t To: \t\t\t"<<
-
bus[n].to<<"\n";
-
vline('*');
-
bus[0].position(n);
-
int a=1;
-
for (int i=0;i<8;i++)
-
{
-
for(int j=0;j<4;j++)
-
{
-
a++;
-
if(strcmp(bus[n].seat[i][j],"Empty")!=0)
-
cout<<"\n The seat no "<<a-1<<" is reserved for "<<bus[n].seat[i][j]<<" .";
-
}
-
}
Do you have iostream reference manual, and, in particular, ofstream?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Spamtrap |
last post by:
I only do occasional Perl programming and most things I write are
short processes. I have something I'm working on that is scanning a
text file with about 15 million lines and trying to extract matches
from another text file, which has about 170 entries. The second text
file is read into an array. The process then scans through the big
file for certain possible patterns - it will find those in about 1 out
of 25 lines,, when it finds one,...
|
by: naknak4 |
last post by:
Introduction
This assignment requires you to develop solutions to the given problem
using several different approaches (which actually involves using three
different STL containers). You will implement all three techniques as
programs. In these programs, as well as solving the problem, you will
also measure how long the program takes to run. The programs are worth
80% of the total mark. The final 20% of the marks are awarded for a...
|
by: naknak |
last post by:
Introduction
This assignment requires you to develop solutions to the given problem
using several different approaches (which actually involves using three
different STL containers). You will implement all three techniques as
programs. In these programs, as well as solving the problem, you will
also measure how long the program takes to run. The programs are worth
80% of the total mark. The final 20% of the marks are awarded for a...
|
by: superc0red |
last post by:
Hey.
I have a big text file with data,
and i want to extract mail addresses.
How i can do it?
|
by: Debadatta Mishra |
last post by:
Introduction
In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |