String handling functions such as strcmp(), strcpy() etc can be used with enumerated types.
A. True
B. False
Answer: Option B
Solution (By Examveda Team)
Enumerated types (enums) in C are used to give names to integer constants. For example:enum days {MON, TUE, WED, THU, FRI, SAT, SUN};This creates an
enum named days where MON is assigned 0, TUE is 1, and so on.String handling functions like
strcmp() and strcpy() work with strings, which are arrays of characters (char). They don't directly work with enum types.You cannot directly use
strcmp() to compare two enum values because strcmp() expects character arrays, not integer values that enums represent. Similarly, you cannot copy an enum value using strcpy().Therefore, the statement "String handling functions such as strcmp(), strcpy() etc can be used with enumerated types" is False.
Join The Discussion
Comments (1)
Related Questions on C Fundamentals
What is the primary purpose of a function prototype in C?
A. Declare a variable
B. Declare a function
C. Define a function
D. Assign a value
What is the correct syntax for declaring a variable in C?
A. int variable_name;
B. variable_name = 5;
C. variable_name int;
D. int = variable_name;

answer is true