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
Explain the extern storage classes in c++.
What is a modifier in c++?
Is swift faster than c++?
What do you mean by inheritance in c++?
What is atoi in c++?
Is c++ a pure oop language?
What does it mean to declare a member function as virtual?
What does ios :: app do in c++?
Is c++ free?
what is COPY CONSTRUCTOR and what is it used for?
What is set in c++?
What are the restrictions apply to constructors and destructors?
What is the oldest programming language?
What are the advantages of using a pointer?
Explain the uses of static class data?