-
my problem
hi,
i'm new to C programming and need a starting point for my problem.
i've got a GIS data file containing a list of points(x and y value on each line, each go to 2 decimal points). i need to read the file and store it in buffer, then find max and min values of x and y.
i don't know what to do!
-
Read them as floats using cin. Read until EOF ( .eof() ) is encountered. Then do a for loop though the buffer looking for the max resp. the min value.
-
ok thanks, but how do i distuinguish between the x and y values, they are separated by a space in the GIS file
-
Code:
float X;
float Y;
cin >> X >> Y;
This will read two floats from the file, whether there are spaces or newlines inbetween.
-
cheers, i'll give it a try!