Declarations
There is an important distinction
between a string and a single character in C. The convention is that single
characters are enclosed by single quotes e.g. * and have the type char. Strings, on
the hand, are enclosed by double quotes e.g. "string..."
and have the type "pointer to char" (char *) or array
of char. Here are some declarations for strings which are given without
immediate explanations.
/**********************************************************/
/*
*/
/*
String Declaration */
/*
*/
/**********************************************************/
#define
SIZE 10
char
*global_string1;
char global_string2[SIZE];
main
()
{
char *auto_string;
char
arraystr[SIZE];
static char *stat_strng;
static char statarraystr[SIZE];
}
0 comments:
Post a Comment