[ create a new paste ] login | about

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

C, pasted on Jun 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <stdlib.h>
#define	N_DATA	50000

int main ( void )
{
	int		i;
	int		data[N_DATA];
	FILE*	fp;

	fp = fopen ( "data.txt", "w" );

	for ( i=0; i < N_DATA; i++ )
	{
		data[i] = rand();
		fprintf ( fp, "%d\n", data[i] );
	}

	fclose ( fp );
}


Output:
1
Segmentation fault


Create a new paste based on this one


Comments: