return 0;
Hi @tariqawni The first code block is using the implied namespace "std" to call cout, while the second code block uses the explicit namespace on cout.
Explicitly using the namespace in the second codeblock isn't necessary but doesn't affect the compiled code.
Consider using Stack Overflow for general C++ programming questions. https://stackoverflow.com/questions/tagged/c%2b%2b
gregvanl when and where can i use each one of them?
@tariqawni They should be equivalent. Most people would use the first version (to avoid extra typing).
If you are new to using C++ and VS Code, consider working through one of the C++ tutorials at https://code.visualstudio.com/docs/cpp/config-linux. You can pick a tutorial that matches your operating system (Windows, macOS, or Windows) and C++ tool chain.
thank u so much thats really help me i am really a new in c++ vscode program i take a course in udemy and ty for u help and if there is any easy way to learn faster c++ would u pls tell me and ty again Eng gregvanl.
Most helpful comment
@tariqawni They should be equivalent. Most people would use the first version (to avoid extra typing).
If you are new to using C++ and VS Code, consider working through one of the C++ tutorials at https://code.visualstudio.com/docs/cpp/config-linux. You can pick a tutorial that matches your operating system (Windows, macOS, or Windows) and C++ tool chain.