Volatile Objects and Member Functions An object which can be modified by some unknown forces (like hardware) other than the program itself can be declared as volatile. Compiler doesn’t apply any optimizations for such volatile objects. Syntax for declaring an volatile object is as follows: volatile ClassName object-name; A member function can be declared as volatile to make the access to member variables to be volatile. A volatile object can access only volatile functions. Syntax for creating a volatile function is as follows: return-type function-name(params-list) volatile; Following program demonstrates both volatile objects and volatile programs: 1 2 3 4 5
The post what are volatile objects and member functions appeared first on Coding Security.
what are volatile objects and member functions
read more
Tidak ada komentar:
Posting Komentar