Page 1 of 1

bool volatile ????

Posted: Fri Jan 17, 2020 7:29 am
by username
So its 2AM and i am beat, but still coding.
I was using some variables that I needed to be volatile.
I accidentally typed the following without catching that i declared it backwards.

Code: Select all

bool volatile system_passed = false; 
Yet it compiled. should it not have thrown a error ?
as it should have been:

Code: Select all

volatile bool system_passed = false;

Re: bool volatile ????

Posted: Fri Jan 17, 2020 7:34 pm
by DrScanlon

Code: Select all

volatile bool system_passed = false;
bool volatile system_passed = false;
Both are correct.