Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to output the content(includes some NTL) directly to the file?

Status
Not open for further replies.

fayeyang

Programmer
Aug 4, 2005
1
US
Hi, I wonder is there any way to out put the result into the file that I can save instead of to screen?

I am using Visual C++6.0 and NTL(which support artibitary long integers). Thanks!
 
Assuming you are currently outputting the result using cout, you can use a file stream and output it with that instead. For example, if you #include <fstream> and add this code to the function that currently outputs the data to the screen:
Code:
std::ofstream fout("filename.txt");
then change cout to fout, it should work.

If you have trouble getting that to work, or it doesn't make sense, you should post some or all of the code that currently outputs information to the screen that you want to change.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top