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 ? | 0 Yes | 0 No |
Post New Answer View All Answers
Search for: what is pair in c++?
What is the two main roles of operating system?
What is the full name of logo?
Define pointers?
Is the declaration of a class its interface or its implementation?
How will you call C functions from C ++ and vice-versa?
Will a catch statement catch a derived exception if it is looking for the base class?
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
What are register variables?
How do you add an element to a set in c++?
What is dynamic and static typing?
Explain polymorphism?
What is the difference between a type-specific template friend class and a general template friend class?
what is COPY CONSTRUCTOR and what is it used for?
What is meaning of in c++?