Hi all
I've just started programming in C, and I've been using CodeBlocks as my compiler. I'm currently writing a small program that does some not-terribly-useful stuff, and I've been getting the following errors:
C:\Documents and Settings\Administrator\Desktop\EP3.c|45|error: invalid conversion from `int' to `int*'|
The code in question is:
iverm = instrucao (&codigo, verm);
Which goes after the following function:
int instrucao (float *codigo, int n){
int ins, i;
ins = i = 0;
i = (n)*(*codigo);
ins = (int)i;
*codigo = i - ins;
return ins;
}
Any ideas about why this might be happening?
I've also been getting the following warnings:
C:\Documents and Settings\Administrator\Desktop\EP3.c|76|warning: int format, pointer arg (arg 2)|
C:\Documents and Settings\Administrator\Desktop\EP3.c|76|warning: double format, pointer arg (arg 3)|
C:\Documents and Settings\Administrator\Desktop\EP3.c|76|warning: int format, pointer arg (arg 4)|
C:\Documents and Settings\Administrator\Desktop\EP3.c|76|warning: double format, pointer arg (arg 5)|
C:\Documents and Settings\Administrator\Desktop\EP3.c|76|warning: double format, pointer arg (arg 6)|
C:\Documents and Settings\Administrator\Desktop\EP3.c|76|warning: int format, pointer arg (arg 7)|
C:\Documents and Settings\Administrator\Desktop\EP3.c|80|warning: double format, pointer arg (arg 2)|
C:\Documents and Settings\Administrator\Desktop\EP3.c|80|warning: double format, pointer arg (arg 3)|
Lines 76 and 80 are:
if (trace == 1) printf ("%d %13.10f %d %13.10f %13.10f %d\n", &passo, &codigo, &iverm, &xant, &yant, &bat);
printf ("\nPosicao final: ( %13.10f, %13.10f )", &xant, &yant);
Again, any suggestions about why this is happening?
Finally, I've been getting this last warning:
C:\Documents and Settings\Administrator\Desktop\EP3.c||In function `int instrucao(float*, int)':|
C:\Documents and Settings\Administrator\Desktop\EP3.c|182|warning: converting to `int' from `float'|
Which seems to have something to do with the function "instrucao" posted above. Line 182 is:
i = (n)*(*codigo);
Thanks in advance for any input!
EDIT: The smiley after `int instrucao(float*, int)' is supposed to be ":" followed by "l".