Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

can someone give me a example of strings from a c++ programm ,

OpenStudy (anonymous):

std::cout << "hiho!";

OpenStudy (anonymous):

this is a cout print method

OpenStudy (anonymous):

The previous answer shows c style strings. Below is an example using the string class from stl. Note that the constructor of the string implicity passes the c-style string to a string constructor which takes a c-style string as an argument. #include <string> int main() { std::string s = "a string"; cout << s.length() << endl; cout << s << endl; return 0; } output: 8 a string

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!