A Example for DLLs

This commit is contained in:
e2hang
2025-12-28 16:11:38 +08:00
parent 721e46be6c
commit 9bdb691602
8 changed files with 850 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "my_str.h"
#define MAX 100
int main() {
char expression[MAX];
printf("Enter an infix expression (e.g., (10+2)*3-4/2): ");
fflush(stdout);//Important: To flush stdout buffer
if (fgets(expression, MAX, stdin)) {
// Remove trailing newline character
expression[strcspn(expression, "\n")] = 0;
double result = evaluate(expression);
printf("Result: %.2f\n", result);
}
return 0;
}