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
file and arrays
file and arrays
Nov 21, 2010 at 5:26pm UTC
AkoTheShadow
(18)
I have the prototype
int read_list(int numbers [], string filename)
and I have 2 .txt files with numbers in them that I'm trying to place in the array to put in my other functions. But I don't know how to put my file's numbers into the array can I get a good shove in the right direction?
Nov 21, 2010 at 6:54pm UTC
hamsterman
(4538)
do you know how to read from a file at all?
(if you don't, see
http://www.cplusplus.com/doc/tutorial/files/
)
Nov 22, 2010 at 3:45am UTC
AkoTheShadow
(18)
I do but that string part is throwing me off I was reading that before I made this post.
Nov 22, 2010 at 12:47pm UTC
hamsterman
(4538)
to convert std::string to const char*, std::string has a member function c_str().
http://www.cplusplus.com/reference/string/string/c_str/
Topic archived. No new replies allowed.