•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 455,969 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,760 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 428 | Replies: 6 | Solved
![]() |
•
•
Join Date: Nov 2007
Posts: 21
Reputation:
Rep Power: 0
Solved Threads: 0
im the newbie among the newbie .....need a nice and patient guy who willing to guide me of my assignment.....cause the deadline is tis weekend......i dun know or can say hard to post the problem out...cause too many.............need urgent reply.........can msn ??? pls pls pls pls...........i got plenty of question to ask......really need a patient guy ........
Last edited by ricnyx : Nov 25th, 2007 at 2:52 pm. Reason: Removed email
•
•
Join Date: Nov 2007
Posts: 21
Reputation:
Rep Power: 0
Solved Threads: 0
haiz....all sleep?
hope tat hav ppl can ans my question now.....
#include <fstream>
#include <iostream>
#include <cstdlib>
int main( )
{
using namespace std;
ifstream in_stream;
ofstream out_stream;
in_stream.open("infile.dat");
if (in_stream.fail( ))
{
cout << "Input file opening failed.\n";
exit(1);
}
out_stream.open("outfile.dat");
if (out_stream.fail( ))
{
cout << "Output file opening failed.\n";
exit(1);
}
int first, second, third;
in_stream >> first >> second >> third;
out_stream << "The sum of the first 3\n"
<< "numbers in infile.dat\n"
<< "is " << (first + second + third)
<< endl;
in_stream.close( );
out_stream.close( );
return 0;
}
wat if i wan to read all integer number ???wat should i do?
hope tat hav ppl can ans my question now.....
#include <fstream>
#include <iostream>
#include <cstdlib>
int main( )
{
using namespace std;
ifstream in_stream;
ofstream out_stream;
in_stream.open("infile.dat");
if (in_stream.fail( ))
{
cout << "Input file opening failed.\n";
exit(1);
}
out_stream.open("outfile.dat");
if (out_stream.fail( ))
{
cout << "Output file opening failed.\n";
exit(1);
}
int first, second, third;
in_stream >> first >> second >> third;
out_stream << "The sum of the first 3\n"
<< "numbers in infile.dat\n"
<< "is " << (first + second + third)
<< endl;
in_stream.close( );
out_stream.close( );
return 0;
}
wat if i wan to read all integer number ???wat should i do?
•
•
Join Date: Aug 2007
Posts: 18
Reputation:
Rep Power: 2
Solved Threads: 1
i will give u a hint u might find atoi function useful...
here is the link...
http://www.space.unibe.ch/comp_doc/c...xponent.c#atoi
i am sorry if i got the question u r asking wrong...
here is the link...
http://www.space.unibe.ch/comp_doc/c...xponent.c#atoi
i am sorry if i got the question u r asking wrong...
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- I Need Urgent Reply (MS SQL)
- help me pls urgent! (C)
- c++ program help pls.... urgent (C++)
- CPU usage in Windows Embeded NT (C)
- Help: How To Call A Domain Name From Another Domain Name In Asp.net (ASP.NET)
Other Threads in the C++ Forum
- Previous Thread: interpretation for a loop
- Next Thread: okay, why is this not working??????



Linear Mode