cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
read file into a 2D array
read file into a 2D array
Oct 31, 2010 at 4:13pm UTC
soad122
(2)
how do i write a function that reads a maze into a 2-dimensional array from the file maze.txt. the maze is a series of spaces and asterisks that has 30 rows and 30 cols.
Oct 31, 2010 at 4:20pm UTC
Albatross
(4553)
std::cin.getline(cin,array[i]) + for loop = solution!
Although ideally, you'd use a 1d array of std::strings.
-Albatross
Topic archived. No new replies allowed.