Strings in C || Learn C Language Onlinee
×

Strings in C

2620

Strings are a group of an array of characters. Followed by null ('\0) character at the end of a string.

Strings Syntax:

char String-name[size of String];

Example:

char string[25];  // Statement 1

Note: The character array can hold twenty-five characters at a time.


Another example of a String:

#include <stdio.h>
int main () {
char greeting[3] = {'H', 'i', '\0'};
printf("Message: %s\n", greeting );
return 0;
}

Result:

Message: Hi



Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments