Comapilation error with Switch statement

Hello ,

How to resolve below compilation error.activity_type is a member of structure and the output from databse will be stored in structure.Expected output wil l be either D or N or C .

sample struct format:
struct a{

char acAtivity_type[2];
}

code:
switch (a->activity_type) {

                            case 'D':
                                    strcpy\(xactivity, "Deleted"\);
                                    break;
                            case 'N':
                                    strcpy\(xactivity, "New_Device"\);
                                    break;
                            case 'C':
                                    strcpy\(xactivity, "Change"\);
                                    break;
                            default:
                                    strcpy\(xactivity, "UNKNOWN "\);
                                    break;
                            \}

Error:

rpt13.c: In function `do_rpt':
rpt13.c:344: switch quantity not an integer
*** Error code 1
make: Fatal error: Command failed for target `rpt13.o'

char acAtivity_type[2];
This is a char array

switch (a->activity_type) {
This requires an int, it is not an int it is a char string pointer.

Spelling counts, C is sensitive to uppercase and lowercase too.

One way to fix it:

struct a{

int acAtivity_type;
}

Note: you can store 'D' in this variable type, char is just a very limited integer datatype.