C
cerr
Why does this little sample app not compile? 
I'm using the CCS compiler version 4.119 and i'm getting the error "A
numeric expression must appear here" by the function call where i
wanna pass Foo as an argument by reference.
Code:
#include <18F87K22.h>
#device HIGH_INTS=TRUE, adc=16, ICD=TRUE
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128
Postscale
#FUSES HSM //Hi-Speed crystal oscillator
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOPLLEN //No PLL enabled
#FUSES BBSIZ1K //1K words Boot Block size
#FUSES NOXINST //Extended set extension and Indexed
Addressing mode disabled (Legacy mode)
typedef struct {
int16 var1;
int16 var2;
int16 var3;
}MyStruct;
MyStruct TestMe;
MyFunc(MyStruct *Foo);
void main (void)
{
TestMe.var1=1;
TestMe.var2=2;
TestMe.var3=3;
MyFunc(TestMe);
}
MyFunc(MyStruct *Foo)
{
Foo->var1=Foo->var2+Foo->var3;
}
Any hints?
Thanks,
Ron
I'm using the CCS compiler version 4.119 and i'm getting the error "A
numeric expression must appear here" by the function call where i
wanna pass Foo as an argument by reference.
Code:
#include <18F87K22.h>
#device HIGH_INTS=TRUE, adc=16, ICD=TRUE
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128
Postscale
#FUSES HSM //Hi-Speed crystal oscillator
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOPLLEN //No PLL enabled
#FUSES BBSIZ1K //1K words Boot Block size
#FUSES NOXINST //Extended set extension and Indexed
Addressing mode disabled (Legacy mode)
typedef struct {
int16 var1;
int16 var2;
int16 var3;
}MyStruct;
MyStruct TestMe;
MyFunc(MyStruct *Foo);
void main (void)
{
TestMe.var1=1;
TestMe.var2=2;
TestMe.var3=3;
MyFunc(TestMe);
}
MyFunc(MyStruct *Foo)
{
Foo->var1=Foo->var2+Foo->var3;
}
Any hints?
Thanks,
Ron