Why a .cpp file can't be run for filename of 2/3 words with space between them?

I created a file with name world of oz.cpp
Everything was okay inspite I couldn’t run it. However on changing its name to world.cpp it ran.

2 Likes

Use double quotes on the name while giving command on terminal or cmd, if you are getting the problem there

g++ "world of oz.cpp"

or you can try

g++ world\ of\ oz.cpp

No, I write as well as run the file in VS code. So that’s not the issue. Please tell me if you know rules of nomenclature.