void Push(stack *S,int data)
{
    if(isFullStack(S))
        printf("Stack is full !!!!  Cannot insert new element\n ");
    else
        S->array[++S->top]=data;
}
Beispiel #2
0
void Push(struct ArrayStack *S, char data){

	if(!isFullStack(S)){
		S->array[++S->top]=data;
	}

}
Beispiel #3
0
void pushStack (stack_t* p, element e)
{
  if (isFullStack(p)) {
    printf("stack is full, cant push");
    exit(1);
  }

  p->contents[++p->top] = e;
}
Beispiel #4
0
int Push(pSqStack s,Elem e)
{
	int ret;
	ret = isFullStack(s);
	
	if(ret == YES)
	{
		printf("Push err\n");
		return ER;
	}
	(s->base)[s->top] = e;
	s->top++;
		
	return OK;
}
Beispiel #5
0
void push(struct stack* S, int data){
	if(isFullStack(S))
		printf("\nOverflow!");
	else
		S->array[++S->top] = data;
}
void push(struct simpleArrayStack *S, int val)
{
    if(isFullStack(S))
        return;
    S->array[++S->top]=val;
}