g++ main.cpp main
./main
why do we use ./ sign? why can't we type "run main" ? Who made this convention? is it purely historical? Also, can we change this ./ to run main forever? I suppose you can do it with bash script?
g++ main.cpp main
./main
why do we use ./ sign? why can't we type "run main" ? Who made this convention? is it purely historical? Also, can we change this ./ to run main forever? I suppose you can do it with bash script?
It has nothing to do with C++, it's your command shell. It's simply the way of telling it that the file exists in the current directory.