Okay😁 I learning that's why I am taking everything very serious.
You are learning it wrong. @Tazmikar's reply to you on the use of volatile variables is wrong. Using volatiles in a multithreaded read/write environment without synchronisation will lead to Undefined Behavior. If used with synchronisation, volatiles serve no more useful purpose than regular variables. The only use for volatiles is in hardware programming where things outside the scope of your program can change the variable.
For ex - I would use a const volatile variable to represent the status register of a processor. This variable will be only read by my program and will not be changed. But the status register can be changed outside of your program by your processor.