character array to string

Joined
Mar 31, 2011
Messages
1
Reaction score
0
Is it possible to read characters from a file, store them into character array, then change the characters to string?
So, let's say in the file, abc is written. I would store each letter 'a' 'b' 'c' into character array using fscanf.
So the array would now contain {'a', 'b', 'c'}.
However, I want them to be put in all together into a string.
What I mean by that is, make 'a' 'b' 'c' into one word "abc".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top