FG
💻 Software

how to compile and run a cpp file using only one command in linux?

Fresh5 days ago
Mar 15, 20268647 views
Confidence Score0%
0%

Problem

Recently I've started to learn cpp language on linux,and now I run a cpp file using following commands. Is there a way to make it one line command such as ?Thanks.

Error Output

g++ -o xxx xxx.cpp
./xxx

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: how to compile and run a cpp file using only one command in linux?

Low Risk

What about this? ? ( means it'll wait until the first task is done, means it'll start it right after it started the first, you do NOT want this one. )

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment