String

The string can be defined as the one-dimensional array of characters terminated by a null ('\0'). The character array or the string is used to manipulate text such as word or sentences.

There are two ways to declare a string in c language.
  • By char array
Let's see the example of declaring string by char array in C language.

char ch[10]={'j', 'a', 'v', 'a', 't', 'p', 'o', 'i', 'n', 't', '\0'};  

  • By string literal
We can also define the string by the string literal in C language. For example:

char ch[]="thearyabhattainstitute";

click on below links...

C gets() & puts()

C String Functions

C strlen()

C strcpy()

C strcat()

C strcmp()

C strrev()

C strlwr()

C strupr()

C strstr()

No comments:

Post a Comment