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
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
What is c++ similar to?
What is c++ redistributable?
What are the methods of exporting a function from a dll?
What is data types c++?
Define stacks. Provide an example where they are useful.
How important is c++?
Please explain class & object in c++?
What is flag in computer?
What is static class data?
What are put and get pointers?
How do you clear a map in c++?
What is the difference between an enumeration and a set of pre-processor # defines?
What is near, far and huge pointers? How many bytes are occupied by them?
What problems might the following macro bring to the application?