Hello all! I am fairly new at C++ but i am currently learning about string / c-string processing. My question is what is more efficient, strings or c-string (otherwise known as character arrays).
the std::string will allow you to program more efficiently in terms of how you manage your time. Of course you can use it incorrectly and write really bad programs regardless of whether you define strings as char[] arrays or std::string objects. I just don't think that it is a fair question to be honest with you. Try defining some requirements. Write the program once with only c strings and once with std::string. Profile both programs and also keep track of how much time you spent writing each program. Look at the generated assembly code for each. There are a lot of factors to consider. Then report to us which is more efficient.