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
Answer Posted / guest
'B' is the answer
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
Why do we need templates?
Differentiate between a copy constructor and an overloaded assignment operator.
What are the storage qualifiers?
Can constructor be static in c++?
What is overloading unary operator?
Explain how functions are classified in C++ ?
What is difference between rand () and srand ()?
Does c++ have finally?
Explain the difference between using macro and inline functions?
Why is c++ so fast?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What is a responder chain?
Explain static and dynamic memory allocation with an example each.
How does com provide language transparency?
How to declaring variables in c++?