[Solved]problem with c macro: #define sc(x)(x*((unsigned long)(1000))

Hi.

I’m trying to make a macro :

#ifndef sc(x)
#define sc(x)(x*((unsigned long)(1000))
#endif

it compile at first but when I try to use it it It gave me this error:

unsigned long x = sc(45);



error: expected ')' before ';' token

   unsigned long x = sc(45);

don’t know what I’ve done wrong.

Thank

Nitrof

It's kind of obvious, you forgot a closing bracket.

#define sc(x)(x*((unsigned long)(1000)))

I would prefer#define sc(x) (x*1000UL)

ho.. yes feeling stupid.. That was it... and thank for the other cue.. looks better I admit.

Thanks a lot.

Regards.

Nitrof