View previous topic :: View next topic |
Author |
Message |
daraos
Joined: 16 Oct 2008 Posts: 18 Location: Chile
|
Error calling a function "a numeric expression must ... |
Posted: Mon Jan 05, 2009 8:44 am |
|
|
Hi everyone , I'm new here, this is my first post. Great forum BTW!
Ok, so here is my problem (probably something obvious I'm failing to see)
Code: |
int CC1100_ReadReg(int dir){
dir=1
return dir;
}
void main(){
int aux;
aux=CC1100_ReadReg(i); // <== Here is the error
}
|
I'm getting error:
Error 51 "Transceptor.c" Line 23(45,46): A numeric expression must appear here
I've stripped the code as much a I could, and the error is still there, what am I doing wrong? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Mon Jan 05, 2009 9:49 am |
|
|
the ; character is missing from dir=1 line
should be:
Code: |
int CC1100_ReadReg(int dir){
dir=1;
return dir;
}
void main(){
int aux;
|
_________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
daraos
Joined: 16 Oct 2008 Posts: 18 Location: Chile
|
|
Posted: Mon Jan 05, 2009 10:16 am |
|
|
Thanks Andrew, but that was a mistake I made posting the code. I tried with other functions, and the error appears when I'm giving a variable to a function. For example:
Code: |
void MyFunction(void){ ..... } //Don't give errors
int MyFunction(void){{ ..... } //Don't give errors
void MyFunction(int address) //Error:A numeric value must appear here |
I tried calling the function with a number and with a variable, and the outcome is the same. |
|
|
daraos
Joined: 16 Oct 2008 Posts: 18 Location: Chile
|
|
Posted: Mon Jan 05, 2009 10:20 am |
|
|
Solved
I failed to close a parenthesis
Thanks for your time |
|
|
|