bool volatile ????

username
Posts: 194
Joined: Thu May 03, 2018 1:18 pm

bool volatile ????

Postby username » Fri Jan 17, 2020 7:29 am

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;

DrScanlon
Posts: 11
Joined: Tue Oct 04, 2016 8:46 pm

Re: bool volatile ????

Postby DrScanlon » Fri Jan 17, 2020 7:34 pm

Code: Select all

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

Who is online

Users browsing this forum: No registered users and 38 guests