cout issue

Hi everyone,

First let me say that this is my first attempt to program with C++. The only prior programming experience I have is learning BASIC back in high school. So I get basic computer theory, beyond that it is all virgin territory. I got a list the C++ commands from: http://www.eg.bucknell.edu/~kvollmay/caps_s2010/C++_summary.pdf , wrote an outline of what I want to do, and now I am setting out to do it. I am using Dev-C++ 4.9.9.2 and selected console app.

However, I didn't get far.

I wrote the following






1
2
3
4
5
6
7
8
9
10
11
12
  #include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    system("PAUSE");
    return EXIT_SUCCESS;
}
// ---- Start Page ----
/cout << "Output sentence";


and get the following errors when I try to compile it

12 C:\Users\Adam\Desktop\main.cpp expected constructor, destructor, or type conversion before '<<' token
12 C:\Users\Adam\Desktop\main.cpp expected `,' or `;' before '<<' token
C:\Users\Adam\Desktop\Makefile.win [Build Error] [main.o] Error 1

From what I read this ought to be pretty straight forward, so why am I having issues???
Last edited on
You need to move line 12 which is outside of main() and insert it just after line 7. Also remove the '/' at the beginning of that line.
I am using Dev-C++ 4.9.9.2

May I point out that that version has not been updated since about 2005. It is obsolete.

Before you proceed any further, I recommend you upgrade to the Orwell version
http://orwelldevcpp.blogspot.co.uk/
current version is 5.4.2, released on 25 May 2013
Many thanks Chervil, for both the help and the advice. :)

Topic archived. No new replies allowed.