Tuesday, September 26, 2023
rated 0 times [  2] [ 0]  / answers: 1 / hits: 5635  / 2 Years ago, sat, may 15, 2021, 3:39:08

I'm new in programming. I run simple C++ program, like this:

#include <iostream>
int main(int argc, char *argv[]) {

by using the terminal by typing g++ Program.cpp.

No error is returned after compiling, but the standard output is not shown on the line, which I think it sohould return What? as typed after std::cout<<.

What can be the cause why the standard output is not shown in terminal?

More From » command-line


Well the g++ command compiles the program. You also have to link and build the program.

Try gcc -o program Program.cpp

After that you'll have to run it:


Also, you forgot using namespace std;

[#25483] Saturday, May 15, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 402
Total Questions: 125
Total Answers: 98

Location: Jersey
Member since Sun, Dec 4, 2022
11 Months ago