Run with g++

I had a fun realization today.

The simple shell script below which I named "run"

g++ $* && ./a.out

would let me compile and run simple programs without it being obvious that there was a compile / link step.

Thus I can just do:

run hello.cpp

and get "hello world".


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s