MCPcopy Create free account
hub / github.com/3rfaan/courses / push

Function push

C/freeCodeCamp/Data Structures/stack-array.c:13–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11int top = -1; // empty array
12
13void push(int x)
14{
15 if (top == MAX_SIZE - 1)
16 {
17 printf("Error: Stack overflow\n");
18 return;
19 }
20
21 A[++top] = x;
22}
23
24void pop()
25{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected