[ create a new paste ] login | about

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

C, pasted on Nov 25:
#include <stdlib.h>
#include "Item2.h"
#include "STACK2.h"
static Item2 *s2;
static int N2;

void STACKinit2(int maxN)
{
	s2 = malloc(maxN*sizeof(Item2));
	N2 = 0;
}

int STACKempty2()
{
	return N2 == 0;
}

void STACKpush2(Item2 item)
{
	s2[N2++] = item;
}

Item2 STACKpop2()
{
	return s2[--N2];
}


Output:
1
2
3
4
5
6
7
8
9
10
11
Line 18: error: Item2.h: No such file or directory
Line 19: error: STACK2.h: No such file or directory
Line 4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In function 'STACKinit2':
Line 9: error: 's2' 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: 'Item2' 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 'STACKpop2'


Create a new paste based on this one


Comments: