I realize this is a problem with how I am sending the arguments, but I can't quite figure out how to get rid of these warnings. I have simplified it and only showed one funcion of my code.
Code:
/* In main */
char *var = "Some text";
box( 1, 2, var);
void box ( int height, int width, char *str ){
char string [height] [width + 20];
sprintf( string, "%s", str );
printf( "%s", string );
}
Here are my warnings
Code:
Progtam.c: In function 'box':
Program.c:27: warning: passing argument 1 of 'sprintf' from incompatible pointer type
/usr/include/stdio.h:265: note: expected 'char *' but argument is of type 'char (*)[(unsigned int)(width + 20)]'
Program.c:28: warning: format '%s' expects type 'char *', but argument 2 has type 'char (*)[(unsigned int)(width + 20)]'
Thank you!