Initializing a string
Strings can be initialized at compile time and at run time.
The process of initializing the strings at compile time is to write the string literal within double quotes.
Compile time initialization is called as static initialization.
Compile time initialization can be done in three ways:
o Char name[10] = “Sri Rama”;
o Char stream[8] = {‘H’, ‘e’, ‘l’, ‘l’, ‘o’, ‘\0’};
o Char str[] = “I like C.”;
IMPORTANT LINKS HARE:
String | Declaring a string | Initializing a string | Different functions used to Input of Strings Data | Different Functions used to Output of strings data
LINKS:
Array | Types of Arrays | Passing Array to Functions | Declaration of Array | Initializing Arrays | Difference between an Array and an Ordinary Variable | String | Declaring a string | Initializing a string | Different functions used to Input of Strings Data | Different Functions used to Output of strings data | Pointer | There are number of reasons for using pointers | Advantages of Pointers | Disadvantages of Pointers | Difference between An Array and Pointer | Storage Class | In C, there are four types of storage classes as below | Differentiate between Automatic Variables and Static Variables | Algorithm | Characteristics/Qualities of a good Algorithm | Flow Chart
Array | Types of Arrays | Passing Array to Functions | Declaration of Array | Initializing Arrays | Difference between an Array and an Ordinary Variable | String | Declaring a string | Initializing a string | Different functions used to Input of Strings Data | Different Functions used to Output of strings data | Pointer | There are number of reasons for using pointers | Advantages of Pointers | Disadvantages of Pointers | Difference between An Array and Pointer | Storage Class | In C, there are four types of storage classes as below | Differentiate between Automatic Variables and Static Variables | Algorithm | Characteristics/Qualities of a good Algorithm | Flow Chart
No comments