Very basic pointer problem
Hi guys, I seem to have a very basic pointer problem.
I have a main that has 2 counters, i need them to be updated by a function, so i decided to declare both int counters, and pointers to these int to pass to the function.
This is how I (tried to) declare them:
Code:
int leftTriCont,rightTriCont;
int* leftTriAbscissa,rightTriAbscissa;
leftTriAbscissa=&leftTriCont;
rightTriAbscissa=&rightTriCont;
so leftTriAbscissa points to leftTriCont and the same with rightTriAbscissa and rightTriCont.
So my idea was to pass the pointers to the function, BUT:
I get an error, both on declaration, and when I call the famous function:
main.c:56: warning: assignment makes integer from pointer without a cast
main.c:160: warning: passing arg 4 of `fastTriangulate' makes pointer from integer without a cast
Why that error? What did i do wrong in the declaration?