Sure, here's a simple implementation of a stack using a singly linked list in C. This version of a stack will be dynamically resizable.

#include <stdio.h>
#include <stdlib.h>

typedef struct Node {
    int data;
    struct Node* next;
} Node;

Node* createNode(int data) {
    Node* newNode = (Node*) malloc(sizeof(Node));
    if (!newNode) {
        printf("Heap overflow\n");
        exit(0);
    }
    newNode->data = data;
    newNode->next = NULL;
    return newNode;
}

int isEmpty(Node* top) {
    return top == NULL;
}

void push(Node** top, int data) {
    Node* newNode = createNode(data);
    newNode->next = *top;
    *top = newNode;
}

int pop(Node** top) {
    Node* temp;
    int poppedValue;
    if (isEmpty(*top)) {
        printf("Stack underflow\n");
        return -1;
    }
    temp = *top;
    poppedValue = temp->data;
    *top = temp->next;
    free(temp);
    return poppedValue;
}

int peek(Node* top) {
    if (isEmpty(top)) {
        printf("Stack is empty\n");
        return -1;
    }
    return top->data;
}

int main() {
    Node* top = NULL;

    push(&top, 10);
    push(&top, 20);
    push(&top, 30);

    printf("Top element: %d\n", peek(top));

    printf("Popped element: %d\n", pop(&top));
    printf("Popped element: %d\n", pop(&top));

    printf("Top element: %d\n", peek(top));

    return 0;
}
In this program, we define a Node structure with an integer data field and a next pointer to the next node in the stack. The createNode function creates a new node with the given data. The isEmpty function checks if the stack is empty. The push function creates a new node and pushes it onto the stack. The pop function pops the top node from the stack and returns its data. The peek function returns the data of the top node. The main function demonstrates the usage of these stack operations.

This implementation dynamically allocates memory for new nodes, so it can handle any number of elements, limited only by the amount of available memory.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence