How to DECLARE cout???

1. Line 2: error: invalid suffix "a" on integer constant
2. Line 17: error: 'cout' undeclared (first use in this function)

How to DECLARE COUT, for God's sake???

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  int First(int a){
int c;
c=2a;
return c;
}

int Second(int d, int e){
int f;
int g=3;
f=First(g)+d+e;
return f;
}

int main(){
int z=5;
int v=6;
cout<<Second(z,v);
return 0;
}


Many thanks!!!
Last edited on
If you want to double size of a,
At 3 line,
c = 2a;
Add asterisk.
c = 2*a;


And Check your code, exist
1
2
#include <iostream>
using namespace std;
Last edited on
Hello!
I am working in codepad
(online)

the point of the question is to call function First from the other no-main function /Second)

Just wanted to see how it works, and why are errors appearing.

Many thanks!
Your question look like "why 1 is a odd number". I thinks you should read some C++ programing book
It happended also that codepad left one program, devcpp wrote "cout not declared" compiling the same program, copied and pasted...

(codepad usually lets programs without

#include<iostream>
using namespace std;

what surprised me, but it is...

p.s. when I fixed it, I gor error:

error: iostream: No such file or directory

Then I did it on devcpp, and got just error:
invalid suffix "a" on integer constant
Last edited on
Topic archived. No new replies allowed.