M
Manuel
Hi, I need to convert a text file in a string or char*. exists some
function that does it? or how can i do it?
Thanks,
bye
function that does it? or how can i do it?
Thanks,
bye
Manuel said:Hi, I need to convert a text file in a string or char*. exists some
function that does it? or how can i do it?
Manuel said:Hi, I need to convert a text file in a string or char*. exists some
function that does it? or how can i do it?
Manuel said:Hi, I need to convert a text file in a string or char*. exists some
function that does it? or how can i do it?
Kai-Uwe Bux said:To initialize a string from a file, you can do:
[ snip std::istreambuf_iterator explanation ]
Manuel said:First, thank you very much by your answers.
I decide to use the solution of Nate because it is more simple and
clearly and it make exactly as i need it.
But, why is kai-uwe's solution better than Nate's solution?
Bart said:Because it achieves the same without using an additional ostringstream
object. It's also a question of style. Some people just love using
iterators for everything. IMHO use whatever is clearer to you.
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.