I've just started learning C++ on Linux. I have written a very small program which compiles but I get run time errors everytime I run it. The code is shown below:
#include<iostream>
int DoubleOf(int n);
int main() {
std::cout << "Double of 5 is " << DoubleOf(5);
return 0;
}
int DoubleOf(int n) {
return n+n;
}
I compile it using g++ main.cpp -o main.out
, without any errors but when I run it, sh main.out
, it outputs:main.out: 3: main.out: Syntax error: Unterminated quoted string
Any help is appreciated.