What is the best way to read a text file and print to console, then grab that string and convert string to a const char?
VUEKID
0
Light Poster
Recommended Answers
Jump to Postmy favorite way is using getline(ifstream, string); and then i would just push everything on to a stack of type const char. you could also use vector, list, queue depending on what you need to use it for
Jump to PostDo you mean const char array?
Jump to Postif it's const char array then you won't be able to add text from a text file to it. But maybe what you want is a function whose parameter is const char*?
All 12 Replies
DTSCode
0
Light Poster
gerard4143
371
Nearly a Posting Maven
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
VUEKID
0
Light Poster
DTSCode
0
Light Poster
gerard4143
371
Nearly a Posting Maven
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
VUEKID
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
gerard4143
371
Nearly a Posting Maven
VUEKID
0
Light Poster
iamthwee
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.