|
|
|
|
|
by gabrielsroka
285 days ago
|
|
1. You should add a URL when you you create a post on HN. You can indent code two spaces on HN, eg: Stack s;
stack_init(&s);
dict_init();
exec(&s, "10 20 + ."); // Prints "30"
exec(&s, "1 2 3 4 .s"); // Shows stack contents
2. Your readme mentions a repl but I don't see it in the source code.3. I'm not an expert in C but I thought header files shouldn't have code in them. The code should be in a .c file 4. Maybe move the code from USAGE into its own .c file. #include "stacklib.h"
int main() {
Stack s;
stack_init(&s);
dict_init();
exec(&s, "10 20 + .");
printf("\n");
return 0;
}
|
|