What is the use of string in c++?



What is the use of string in c++?..

Answer / Vishal Nigam

The use of a string in C++ is to handle sequences of characters, which can be manipulated easily using built-in functions. It is a class template that encapsulates a null-terminated character array and provides a variety of methods for operations like concatenation, searching, replacing etc.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Can you explicitly call a destructor on a local variable?

1 Answers  


class X { private: int a; protected: X(){cout<<"X constructor was called"<<endl;} ~X(){cout<<"X destructor was called"<<endl} }; Referring to the code above, which one of the following statements regarding "X" is TRUE? a) X is an abstract class. b) Only subclasses of X may create X objects. c) Instances of X cannot be created. d) X objects can only be created using the default copy constructor. e) Only friends can create instances of X objects.

2 Answers   Quark,


What is an undefined reference/unresolved external symbol error and how do I fix it?

1 Answers  


Difference between a copy constructor and an assignment operator.

1 Answers  


What is a pointer with example?

1 Answers  


Write any small program that will compile in "C" but not in "C++"

10 Answers   Honeywell,


What is a terminating character in c++?

1 Answers  


Can I learn c++ without c?

1 Answers  


Why is it called c++?

1 Answers  


Can a built-in function be recursive?

1 Answers  


What are the different types of Storage classes?

5 Answers  


What is pair in c++?

1 Answers  


Categories