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

How do I tokenize a string in c++?

0 Answers  


In the derived class, which data member of the base class are visible?

0 Answers  


Difference between struct and class in terms of access modifier.

0 Answers  


How are virtual functions implemented in c++?

0 Answers  


What is the purpose of ios::basefield in the following statement?

0 Answers  






What is virtual destructor? What is its use?

0 Answers  


Why do we use double in c++?

0 Answers  


What is a container class? What are the types of container classes?

1 Answers  


What is c++ & why it is used?

0 Answers  


What is a loop? What are different types of loops in c++?

0 Answers  


Explain terminate() function?

0 Answers  


How much is c++ certification?

0 Answers  


Categories