Why when comment part is accessible the compilator doesn't out them. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why when comment part is accessible the compilator doesn't out them.

#include <iostream> using namespace std; class myclass { public: void funcHi() { cout << "hi" << endl; }; int funcclear; string funcright; string funcstring() { cout << "it is func right" << endl; } }; int main() { myclass test; /* test.funcHi(); test.funcstring();*/ test.funcclear = 15; test.funcright = "Right"; cout << test.funcclear << endl; cout << test.funcright << endl; return 0; }

24th Sep 2019, 10:43 AM
Vadim Shymansky
Vadim Shymansky - avatar
1 Answer
+ 3
Whatever is inside comments /**/ won't get compiled. They are meant to be used as comments to orient someone else who might look at your code, as you probably didn't know you can comment pieces of code to test it. Hope I answered ur question bro
24th Sep 2019, 11:07 AM
Minerals2016
Minerals2016 - avatar