Constant & String In C Programming

Explain Constant & String In C Programming With Examples
Get Our Latest Interview Questions: Aptitude, Reasoning, English, GD, HR-PI

3. Constant: 
Constant means fixed. So in c programming constant means fixed value, if we make any variable as constant then so in hole program his value will never changed or during the program execution value is remain same. 
To make any variable as constant const keyword is used.  

Constant Example: 
int a = 5 const; 
So in hole program whenever we use a variable his value should be 5.

4. String: 
String is collection of characters. 
Or we can also characters as a string. 
To declare string we use char keyword and then we need to give name and then in between [ ] we need to write length of string.  
       
Syntax Of Declaring String: 
char string_name[string_size] 

String Ex: 
char technical[50];  

Here technical is a string name and it contains 50 characters.

Expert Review: Constant & String both are having there own identity in c programming, many times we need to put some variable constant then that time we need constant and to take some character value we need String.


 Enter Your Email Id To Get Our Programming, Web Development, Video Tutorial, Job Updates In Mail :

Labels: