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 4 of 5.

Ravi said:   1 decade ago
It is necessary to declare variable in this format.

Animesh said:   1 decade ago
We can't use special symbol in a variable name excluding underscore(_)

Thiru said:   2 decades ago
Names must not begin with a digit.??Is this is right?

Sachin said:   1 decade ago
Variable name can be 32 character. (this is system dependent).

What is exact meaning of variable name is 32 character?

What is meaning of system dependent?

Supriya said:   1 decade ago
What are the other symbols mentioned in the options used for?

Ragaveni said:   1 decade ago
To @Sudi as per me,

We cannot use any other symbol except (_) and always variable name starts with a letter or (_) after any one of this we can use digits.

Anandrao said:   1 decade ago
The identifiers can start with the $ and _.

But they cannot start with the Digits like 0123456789.

Drashti said:   1 decade ago
@Sachin.

it means that variable name can contain only 32 characters not more than it system depend means it is dependent on system that how many character system will allow.

Ex. Assume that one system allow 32 char. Other allow 28.
So i hope YOu understand.

Manju said:   1 decade ago
Is int *a also possible in pointers.

Umakant said:   1 decade ago
Means variable name max 32 characters only.


Post your comments here:

Your comments will be displayed after verification.