Vidyalelo
C Programming · Q284

C Fundamentals

Programming · C Programming · question 284

Q284

String handling functions such as strcmp(), strcpy() etc can be used with enumerated types.

A.
True
B.
False
Answer

Answer: Option B

Solution

Answer: Option B
Solution:
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.