-->
Page 1 of 1

What does || mean in an if statement

PostPosted: Tue Mar 20, 2018 1:46 am
by MikeyK
Hi,
I'm new here so sorry if this is in the wrong area, or a really simple question.
I've been looking at Arduino and WeMos projects for a while and finally started with a project.

What do the || (two concatinate signs) mean in the if statement below?
I've been reading through documentation on 'if' syntax but I can't find anything about || in an if statement.

if( total_tank_levels == NUM_MINMAX_TANK_LEVELS || reset_min_max_levels ) {
unsigned short min_level = 65535, max_level = 0, changed = 0;
for( i = 0; i < NUM_MINMAX_TANK_LEVELS; ++i ) {
if( last_tank_levels[i] < min_level )
min_level = last_tank_levels[i];
if( last_tank_levels[i] > max_level )
max_level = last_tank_levels[i];

Cheers,
Michael

Re: What does || mean in an if statement

PostPosted: Tue Mar 20, 2018 11:32 am
by schufti

Re: What does || mean in an if statement

PostPosted: Wed Mar 21, 2018 6:29 am
by MikeyK
Cheers thanks