c ++ – If I declare a variable and use it in the program text, will it be compiled?

That depends on the compiler configuration. You can enable or disable this. It is a very easy way to find out the standard of your compiler, to compile under these conditions, and to check if it is compiled. I recommend keeping the connection and leaving a variable undeclared and unused. It is forgotten there and the code is disorganized if it was not used. Delete him.