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
Where do I find the current c or c++ standard documents?
What are references in c++?
Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).
What is a virtual destructor? Explain the use of it?
Explain what happens when a pointer is deleted twice?
Difference between overloading vs. Overriding
Explain unexpected() function?
What are the various storage classes in C++?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?
What is oops in c++?
Is c++ vector a linked list?
Is c++ used anymore?
What are member functions used in c++?
Is swift a good first language?
What are the two types of comments?