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
What is the difference between struct and class?
Is swift better than c++?
What is an inclusion guard?
What is a base class?
List down the guideline that should be followed while using friend function.
Describe linked list using C++ with an example.
Is facebook written in c++?
What is a class definition?
How do you write a function that can reverse a linked-list?
What are all predefined data types in c++?
Do you know the problem with overriding functions?
What is static class data?
Describe the advantages of operator overloading?
Please explain the reference variable in c++?
What is the use of volatile variable?