C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 3)
3.
Which of the following special symbol allowed in a variable name?
* (asterisk)
| (pipeline)
- (hyphen)
_ (underscore)
Answer: Option
Explanation:

Variable names in C are made up of letters (upper and lower case) and digits. The underscore character ("_") is also permitted. Names must not begin with a digit.

Examples of valid (but not very descriptive) C variable names:
=> foo
=> Bar
=> BAZ
=> foo_bar
=> _foo42
=> _
=> QuUx

Discussion:
42 comments Page 5 of 5.

Monisha said:   6 years ago
Then what is the purpose of *(asterisk) , | (pipeline), - (hyphen)?
(1)

A.yamini said:   5 years ago
Why we use only underscore ?why not other symbols for variable name?
(3)


Post your comments here:

Your comments will be displayed after verification.