+ 1
Variable Naming rules ?
in C++ Course, section 3. it stated as follow : Variable Naming Rules C++ keyword (reserved word) cannot be used as variable names. For example, int, float, double, cout cannot be used as a variable name. i used cout as variable name , and it work.😁😁😁 https://code.sololearn.com/cE1321gl4m1X/?ref=app
2 Antworten
+ 5
That's because "cout" is not a reserved word. It's actually a variable, and as such is subject to variable naming rules itself.
Another reason you're allowed to use it is the fact it exists in the "std" namespace. If you use "using namespace std;" (thus moving it into the global namespace), you'll get an error since it will already be defined.
+ 1
thanks @Squidy