I am outputting a bunch of number to a text file and they just keep going in that text file on one line. Is there a way to make it do wordwrap or to have the numbers go to another line after it prints say 10 numbers?
Thanks for any input.
Doug
If you want to go to the next line, just print a "\n" or endl.
inFile<<endl;
or
inFile<<"\n";
For it to go a new line after every 10 numbers, you could do a loop or something.
Example:
Code:for (int i=0;i<total;i++) //A for loop to go through all number { cout<<num[i]; //Outputs Number if ((i%10==0) && (i!=0)) cout<<endl; // Check if it's every 10 number. Print line if it is }
Last edited by telboon; 08-17-2008 at 10:53 AM.
Use the code tags dude.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks