I am new to programing and was wondering how to read in a file of integers and then put those integers into an array?
Printable View
I am new to programing and was wondering how to read in a file of integers and then put those integers into an array?
Too broad of a question, so here's a broad answer. Read a line from the file using fgets. Parse the line using strtod, sscanf, or others.
Oops. C++ board.
Same thing, mostly. Read a line using getline (preferably into a std::string). Parse much the same or use std::stringstream.