having problem while copieing function returned char array to a char array using strcpy

char *getIcType(Ic ic){
static char icType[5];

switch(ic.type){
//some code
}

return(icType);
}

In main
{
char icType[5];
//some code

strcpy(icType,getIcType(ic));
}


Its compiling , while running the code its showing some memory fault error
Topic archived. No new replies allowed.