Society of Robots - Robot Forum

Software => Software => Topic started by: Jdog on January 18, 2009, 02:25:26 AM

Title: Quick C question on and function
Post by: Jdog on January 18, 2009, 02:25:26 AM
Just a quick question because I don't really know the C syntax.
If I want to say something like
if(scan_angle < 600) and(sharp_ir < 150)
{

(that's not the correct syntax)
how would I say it, because when I try this I get.

control.c:90: warning: implicit declaration of function 'and'
control.c:91: error: expected ';' before '{' token

I'm sorry if this has been asked before, but you get a lot of results when you search for C and Programming.
Title: Re: Quick C question on and function
Post by: householdutensils on January 18, 2009, 02:57:18 AM
I think your issue is with the operator.

if (scan_angle < 500 && sharp_ir <150)
{

// Do some bidness

}