Problem with C function of type char pointer, can someone explain?
- by JJ
Find the errors from following C function :
char* f(int i) {
int i;
char buffer[20];
switch ( i ) {
1: strcpy( buffer, "string1");
2: strcpy( buffer, "string2");
3: strcpy( buffer, "string3");
default:
…