Author Topic: Quick C question on and function  (Read 2598 times)

0 Members and 1 Guest are viewing this topic.

Offline JdogTopic starter

  • Robot Overlord
  • ****
  • Posts: 259
  • Helpful? 3
Quick C question on and function
« 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.

Offline householdutensils

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 2
Re: Quick C question on and function
« Reply #1 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

}

« Last Edit: January 18, 2009, 03:01:09 AM by householdutensils »

 

SMF spam blocked by CleanTalk