Like numbered arrays, C handles character arrays (strings). Each string is identified as a character array and ends with a ‘\0’(null) character (the compiler automatically adds the null character). So the end of string is identified as a null character. Being an array, all the elements of the string array stored in continuous memory locations following is the declaration of character array char name[50]; or char name[]=”Pradeep Kumar”; or char name[20]=”Hello Pradeep”; Strings can be handled or manipulated through loops or library functions. There are some library functions to handle strings are available at string.h Some of them are strlen(string) This is to find the length of the string and returns an integer For example, if “Hello” is the string, the length will be 5 and “Hello “, the length is 6 (there is a blank space after o in hello) strcat(String1, string2) to concatenate two strings One string will be appended to a
Its all about Network Simulations (NS2, NS3), Internet of Things, Sensor Networks, Programming, Embedded Systems, Cyber Physical Systems, etc