answersLogoWhite

0


Best Answer

Character arrays or pointers to character are termed as strings in c language. Like:

char arr[10] = {'s', 't', 'i', 'n', 'g'};

char *pchar = "string";

Above answer is the first answer for the question

But there is a lot of difference between character array and string.

string means a group of characters .And string is enclosed between double quotation marks i.e(" ") .

Declaration of string is same as of char array ,which is as follows

char str[20];

And initialization is different from that of character array

initialization:-

char str[7]={"vardhan"};

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

A string is an array of characters, typically of variable length, terminated with a null character.

char sz[] = "This is a string.";

The array sz has length 18, including the terminating null ('\0') character.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Essentially, a String in java is a non-primitive data type that stores plaintext. Of course you can go much deeper with this into how memory allocation occurs for a string, etc. but essentially a string is an array of characters, such as: "Text!", in which java simply sees it as T in point 0 (counting in arrays, ArrayLists, strings, etc. starts with index zero and goes to object length -1) with a e in point 1, etc. Essentially, when you type the code:

String myString = "Hello";

Java is doing this:

char[] (name) = new char[]{'T', 'e', 'x', 't', '!'};

where (name) is some system-assigned name,

Then assigning a pointer of type String to the char array it just created.

As java is quite a user-friendly language, it hides this stuff behind a non-primitive datatype String, which is truly a class which (to put it simply) handles the creation and access of the char array, with things such as substrings, etc. built into String.class.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

The only example of a string is an array of character data types. The only real difference between string types is the length of each character. For instance, ANSI and UTF-8 strings are encoded as an array of single byte character widths. In some languages, the first element of the array denotes the length of the string (in characters) while in others, a null-terminator denotes the end of a string. Null-terminated strings are more common as they allow strings of any length (memory permitting) whereas length-encoded ANSI strings (for example) would be limited to a maximum of 255 characters.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

String is a group of characters which ends with a '\0'. String is accessed by refrencing their index given to them

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

a string is a sentence, word or a heap of random letters.

I KNOW BECAUSE I USE STRINGS

IN PROGRAMMING ALL THE TIME

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

string is nothing but the set of characters.

during programming we enclose them with double quotes, to represent them.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

A string is a null-terminated array of type char.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do you mean by string in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is literal in c language?

a string constant


How can you read string in C language?

You mean read from file/standard input? With function fgets.


Special character in C language?

special character in c language are as follows~ ' ! @ # % ^ & * () _ - + = | \ {} [] : ; " <> , . ? /


Definition of buffer in assembly language?

its just like a string of c++


What do you mean by string in java programming?

A "string" in any programming language is a line of text.


What do you mean by c language?

C is a programming language.


How you can convert from string to int in C language?

Use the atoi() or atol() function.


How print the string with double cot in c plus plus language?

console.wrikerle("""");


Int a is literal in C language or not?

int a; -- variable definition"int a" -- string literal


What is the syntax for string in c?

The C programming language has no notion of a string. The C runtime libraries interpret a string as an array of 'char' (sometimes 'unsigned char'), where a byte (char) with numerical value zero (often written as '\0' in C) denotes the end of the string. Modern variations also support modern forms of strings based on different data types (wchar, etc) in order to support more complex encodings such as Unicode. These, too, are interpretations of combinations of language features, but not a built-in part of the language.


What symbol or character determines end of string?

In C programming language, a string is an array of characters which is always terminated by a NULL character: '\0'


What are the functions of Atoi itoa and gcvt in C language?

All these are conversion functions - atoi()-string to integer.itoa()-integer to string.gcvt()-double to string