I'm new here and just getting into C++ and would really appreciate your help.
I would like to know how to change columns each time i wanna write new data to a text file.
For e.g i have a nested loop such as:
Expand|Select|Wrap|Line Numbers
- for (int i=0;i<5,i++)
- {
- data=100*`i;
- for (int s=0;s<20,s++)
- {
- char Name[30];
- sprintf(Name,"Name%d.txt",s+1)
- ofstream tfile( Name,ios::app);
- tfile << data;
- }
- }
Please advise.
Surosh.