How to create the structure of a basic stack expressed as a struct like this:
struct stack {
data[];
int top;
}
here is my code and the software gives an error : "expected identifier or"(" before "[" token:
#include <stdio.h>
#include <stdlib.h>
#define MAX 100
#define true 1
typedef int data[MAX];
struct stack
{
data[];
int top;
};
typedef struct stack stack;
int isEmpty(stack); //Hàm kiểm tra xem stack rỗng hay không
int isFull(stack); //Hàm kiểm tra xem stack đầy hay không
void push(stack*, int value); // Hàm thêm giá trị value vào đỉnh stack
int peek(stack); //Hàm trả về giá trị trên đỉnh stack
int pop(stack*); //Hàm xoá phần tử trên đỉnh stack, đồng thời trả về giá trị đó
int main()
{
}