[ create a new paste ] login | about

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

C, pasted on Jun 8:
#include <stdio.h>
#include <conio.h>
#include <string>
#include <iostream>
using namespace std;

int main()
{

	char s[3][100] = {"Tai dep trai", "Tai hoc gioi", "Tai xi xon"};

	for(int i = 0; i < 3; i++)
	{
		printf("\nTen thu %d la: %s", i + 1, s[i]);
	}


	string str[] = {"Nguyen Viet Nam Son", "Luu Gia Han", "abcxyz"};
	for(int i = 0; i < 3; i++)
	{
		cout << "\nTen thu " << i + 1 << " la: " << str[i];
	}
	system("pause");
	return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Line 18: error: conio.h: No such file or directory
Line 17: error: string: No such file or directory
Line 19: error: iostream: No such file or directory
Line 5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'
In function 'main':
Line 12: error: 'for' loop initial declaration used outside C99 mode
Line 18: error: 'string' undeclared (first use in this function)
Line 18: error: (Each undeclared identifier is reported only once
Line 18: error: for each function it appears in.)
Line 18: error: expected ';' before 'str'
Line 19: error: redefinition of 'i'
Line 12: error: previous definition of 'i' was here
Line 19: error: 'for' loop initial declaration used outside C99 mode
Line 21: error: 'cout' undeclared (first use in this function)
Line 21: error: 'str' undeclared (first use in this function)


Create a new paste based on this one


Comments: