Which of the following cannot be a variable name in C?volatilefriendtrueexport
Question
Which of the following cannot be a variable name in C?volatilefriendtrueexport
Solution
The following cannot be a variable name in C:
-
volatile: This is a keyword in C used to declare a variable as volatile. A volatile keyword in C is a type qualifier that tells the compiler not to optimize the object that is associated with the volatile keyword.
-
friend: This is not a keyword in C, but it is a keyword in C++. In C++, it is used to grant a non-member function access to the private members of a class. However, in C, it can be used as a variable name.
-
true: This is a macro in C which is defined in the header file stdbool.h. It is used to represent the boolean true in C.
-
export: This is not a keyword in C, but it is a keyword in C++. In C++, it is used to export templates. However, in C, it can be used as a variable name.
So, the words "volatile" and "true" cannot be used as variable names in C.
Similar Questions
Which of the following is not a valid C variable name?
elect the correct answerWhat is the purpose of the volatile keyword in C?OptionsTo specify the size of a data typeTo indicate that a variable may be changed at any timeTo declare a constantTo define a pointer
Which of the following is NOT a valid way to declare a variable in C?
Which of the following is an invalid identifier in C?
Which keyword is used to prevent any changes in the variable within a C program?Answer areaa) immutableb) mutablec) constd) volatile
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.