[ create a new paste ] login | about

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

C, pasted on Jan 11:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
int main (){
	int *a;
	int n;
	printf ("nNhap so luong phan tu cua mang : ");
	scanf ("%d",&n);
	a = (int *)malloc (n *sizeof (int *));
	//nhap mang.
	for (int i = 0;i < n;i++){
		printf ("nNhap a[%d] = ",i);
		//c1 :
		scanf ("%d",&a[i]);
		 //c2 :
		 //scanf ("%d",(a+i));
	}
          //xuat mang
	for (int i = 0;i < n;i++){
		//printf ("t%d",a[i]);
		//c2:
			printf ("%dt",*(a+i));
	}
	getch ();

}


Output:
1
2
3
4
5
6
Line 18: error: conio.h: No such file or directory
In function 'main':
Line 11: error: 'for' loop initial declaration used outside C99 mode
Line 19: error: redefinition of 'i'
Line 11: error: previous definition of 'i' was here
Line 19: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: