reading in

Associate
Joined
10 Nov 2007
Posts
809
Location
Southampton
hi

im using c++ and need to read in a text file which has a list of x and y coordinates

my initial idea was to read them in using ifstream and then store them into a 2d array instead of a linked list as i know how many elements i have

just wondering if this sounds an ok thing to do or should i use a different stream input method?

PCDave
 
ive now read in my data fine however i now need to insert x and y into one method call. is a good way to do it to have a nested for loop and start the second one at place one in the array while the first one starts at zero and increment them accordly. once i have done that my next question is how do i insert there values into a single method call glVertex2f(x,y) where x is the x coordinate and y is the y coordinate.
 
Last edited:
Back
Top Bottom