[ create a new paste ] login | about

Link: http://codepad.org/2XkUvmnZ    [ raw code | output | fork ]

C, pasted on Jan 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;

void HoanVi(int* x, int* y) // int* x = &a;  int* y = &b;
{
	int temp = *x;
	*x = *y;
	*y = temp;
}

void main()
{
	int a = 1;
	int b = 2;
	HoanVi(&a, &b);
	cout << "a = " << a <<" ,b = " << b;
	system("pause");
}


Output:
1
2
3
4
5
6
7
Line 19: error: iostream: No such file or directory
Line 2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'
In function 'main':
Line 16: error: 'cout' undeclared (first use in this function)
Line 16: error: (Each undeclared identifier is reported only once
Line 16: error: for each function it appears in.)
Line 12: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: