Creating a 50 x 50 grid

I had a question about C++ if anybody can answer it for me, I will really appreciate it.

Say I create an output file and I want to create a 50 x 50 grid in the file. How can I do this without using multidimensional arrays? I was thinking of this. However, I think the newline character on each line is not considered to be part of the canvas:

//set up 50x50 canvas
for(int i = 1; i <= 50; i++)
{
    outfile.put(' ');
    for(int j = 1; j <= 50; j++)

    outfile.put('\n');
}
//reset pointer to start of file
outfile.seekp(0, ios::beg);

One of the things I wish to accomplish with this grid is to be able to move the pointer around. Any help will be appreciated

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image