hi there, i do hope someone can help with my delima. yes this is homeowork but i am 80% through my program and only wish to get some guidance on my program.
my program has a number of things it has to do and one the things i am having trouble with is being able to read a text file with x and y points in it and then use those points to display a XY Canvas plot. i have got the plot working with user input points but cannot get it to read a file.
this is my canvas XY plot code (without the user defining the values for x and y):
int i, j, x, y;
char plot[21][75] = {'.'};
plot[x][y]='+';
for(i=20; i>-1; i--)
{
for(j=0; j<75; j++)
{
plot[i][j]='.';
plot[x][y]='+';
cout<<plot[i][j]; }
cout<<"\n";
where plot[x][y]='+'; will be the points i wish to read from the file.
now i tried using this in front of the previous code:
ifstream File;
File.open("c\\temp\\sample.txt");
int i, j, x, y;
File>>x>>y;
but once the program executed it just stopped and closed.
any help would be very helpful!!!
cheers