Examveda

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.

This Question Belongs to C Program >> C Fundamentals

Join The Discussion

Comments (1)

  1. Gamma Killer
    Gamma Killer:
    9 months ago

    answer is true

Related Questions on C Fundamentals