It might sound stupid to most of you.....but it is the first time i want to write 2 columns of data in a txt file.....The first column will be an index of the second column. The second column has constant length but the index will have length from 1 to 4 digits(1-5000) and i would like to know what should i do or use in order to have a constant size for the first column(say 4 digits).I would like to have 2 "tidy" columns
say i have
ofstream file; file.open("text.txt"); ............ code ............ file<<index<<data[index]<<endl; file.close();
where index is a loop counter and data is an array.
Thanks in advance mates