thanks uolj,
thats what I was looking for. I am using the following to read the file:
for (int i = 0; i <= M -1; i++)
{
for (int j = 0; j <= N -1; j++)
{
InputFile1 >> imatrix[i][j];
}
}
and I wanted to test for a...
How do I detect end of file when reading from a file. I have tried cin.eof(), but I think this is only for reading from keyboard input.
Also, does c++ automatically detect white space when reading files or is it ignored?
Thank you all,
dnnymak
I am trying to read a .pgm file into an array. The code I was given has the following variable declaration:
int **image;
what does the "**" mean before image?
thanks,
Dnnymak
Maybe I dont know what a class is. I have been creating classes like functions, which has been a lot of work. I guess a class should be a collection of functions, like a car has wheels, brakes ... I think I am trying to make my car class out of a bunch of little classes. Does that make sense?
Sorry about the confusion, I was using that as an example (I meant cross product). Anyhow, I am taking a computer graphics class and am doing some ray tracing. Therefore I am doing a lot of vector math and am trying to keep it portable by creating classes to do some of the work. I am fairly new...
I am trying to create a class that does a Dot-product; it returns an x, y and z value for a vector. I have implemented it so that I have to call it 3 times to get each value. Very inefficient!
Can I return an array from a class? I have been able to read an array into my class, but can't figure...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.