Re-watch about namespace. In C++ global variables can potentially pollute the namespace by making it more difficult to disambiguate between variable names and other entities with the same name. This can lead to code that is harder to read and maintain. It's generally recommended to use namespaces or other scoping mechanisms to avoid this issue.
#include
int myNum = 3; //global
void printNum();
int main()
{
int myNum = 1; //local
printNum();
std::cout
I really like your C++ series. Keep it up. Please make more C++ Videos. So, let's defeat the UA-cam algorithm.
std::cout
Yu the best ❤️
what do you mean by " "pollutes" the global namespace " ?
Re-watch about namespace. In C++ global variables can potentially pollute the namespace by making it more difficult to disambiguate between variable names and other entities with the same name. This can lead to code that is harder to read and maintain. It's generally recommended to use namespaces or other scoping mechanisms to avoid this issue.
❤ ❤
so what is printNum and how is it related to myNum
#include
int P =3.14;
int main(){
std::cout
yo
comment = rand(random_comment) % 100;
std::cout