Is there a datatype string in c++?How is the memory allocation?

Answer Posted / nithin devang

There is no DataType called String in C++.
String can be created using character array and delimited by
null character i.e. '/0'.
like char name[]={'n','i','t','h','i','n','
','d','e','v','a','n','g','0'}
or
char name={"nithin devang"}//it will automaticall append
null char.
Null character is having value (ASCII) Zero. (0 character
dont have ascii value 0)
--
If you still wish to use the keyword string you may declare
a macro
#define String char[];

my answer surety %=98%
-------------------
Read Expert C programming, The deep C secrets by Peter Van
Der Linden

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What kind of problems can be solved by a namespace?

591


What is virtual table?

615


Can I uninstall microsoft c++ redistributable?

605


What do you understand by pure virtual function? Write about its use?

577


What is a pdb file?

535






What is pure virtual function?

623


How can a called function determine the number of arguments that have been passed to it?

655


How would you use the functions sin(), pow(), sqrt()?

739


What is the average salary of a c++ programmer?

536


What is object in c++ example?

623


what is a reference variable in C++?

662


What's the hardest coding language?

572


What are virtual constructors/destructors?

577


What does iomanip mean in c++?

601


Which operator cannot overload?

541