[ create a new paste ] login | about

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

C, pasted on Nov 25:
#include <stdlib.h>
#include "Item1.h"
#include "STACK1.h"
static Item1 *s1;
static int N1;

void STACKinit1(int maxN)
{
	s1 = malloc(maxN*sizeof(Item1));
	N1 = 0;
}

int STACKempty1()
{
	return N1 == 0;
}

void STACKpush1(Item1 item)
{
	s1[N1++] = item;
}

Item1 STACKpop1()
{
	return s1[--N1];
}


Output:
1
2
3
4
5
6
7
8
9
10
11
Line 18: error: Item1.h: No such file or directory
Line 19: error: STACK1.h: No such file or directory
Line 4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In function 'STACKinit1':
Line 9: error: 's1' undeclared (first use in this function)
Line 9: error: (Each undeclared identifier is reported only once
Line 9: error: for each function it appears in.)
Line 9: error: 'Item1' undeclared (first use in this function)
t.c: At top level:
Line 18: error: expected ')' before 'item'
Line 23: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'STACKpop1'


Create a new paste based on this one


Comments: