string somestring ;
Which of the following choices will convert a standard C++
string object "somestring" to a C string?
a) Copy.somestring () ;
b) somestring.c_str ()
c) &somestring [1]
d) std::cstring (somestring)
e) (char *) somestring



string somestring ; Which of the following choices will convert a standard C++ string object &qu..

Answer / guest

'B' is the answer

Is This Answer Correct ?    9 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is the best c++ book?

0 Answers  


Why do we use double in c++?

0 Answers  


Write about the scope resolution operator?

0 Answers  


Is c better than c++?

0 Answers  


What is the return value of the insertion operator?

0 Answers  


What do you know about friend class and friend function?

1 Answers  


What is the difference between global variables and local variable

0 Answers  


What is the best way to declare and define global variables?

0 Answers  


What is slicing?

1 Answers  


Can c++ be faster than c?

0 Answers  


What is the use of bit fields in structure declaration?

0 Answers  


What is copy constructor? Can we make copy constructor private in c++?

0 Answers  


Categories