I'm getting the following error althrough the program is compiling a exe. I've been learning pointers and while playing with integers was fine, adopting the same stragety with a character array of 4, this warning is cropping up.
function prototype in place.error: incompatible types in assignment
warning: passing arg 1 of `setAlphaPosition' from incompatible pointer type
declaration is as follows:Code:void setAlphaPosition(char *alphaPos[4], int x);
calling the function below:Code:char alphaPosition[4];
Code:setAlphaPosition(&alphaPosition, 3);Anyone know what needs adjusting.Code:void setAlphaPosition(char *alphaPos[4], int x) { /* uses pointer to update string with the alphabetical expression given in regards to position, first, second, third etc .. */ if ( x == 0 ) *alphaPos = "1st"; else if ( x == 1 ) *alphaPos = "2nd"; else if ( x == 2 ) *alphaPos = "3rd"; else if ( x == 3 ) *alphaPos = "4th"; else if ( x == 4 ) *alphaPos = "5th"; else if ( x == 5 ) *alphaPos = "6th"; }



LinkBack URL
About LinkBacks




