C - String



Arrays and Strings in Tamil


 c-string

Learn C - C tutorial - C string - C examples - C programs

C String - Definition and Usage

  • In C- Programming, Strings are nothing but the array of characters ended with null character (‘\0’).
  • This null character indicates the end of the string.
  • Strings are always enclosed by double quotes. Whereas, character is enclosed by single quotes in C.
C String
code-explanation-string

Sample - C Code

#include <stdio.h>
#include <conio.h>
void main ()
{
   char a[20] = "wikitechy.com";
   printf("The string is : %s \n", a);
   getch();
}

C Code - Explanation

code-explanation-string
  1. Here in this statement we declare the character array with the name of the variable name as “a” and the size of the array as “20” .
  2. In this statement we print the string value of the variable “a”..

Sample Output - Programming Examples

code-explanation-string-output
  1. Here in this output we print the string “wikitechy.com” as shown above.

View More Quick Examples


Related Searches to c string