Open Carvalanga opened 3 weeks ago
Hello, roommate! I found a bug in your code. If you try to create stack witch size is too big you program will crash! Look at this code in main:
#include "stack.h" #include "log.h" #include <cstdio> int main() { Stack stk = {}; // stk.logFile = fopen("logfile.htm", "w"); logInit(stk.logFile); DO_STACK_CTOR(&stk, 10000000000000000); DO_STACK_PUSH(&stk, 20); printf("DONE\n"); DO_STACK_DTOR(&stk); return 0; }
Hello, stack ctor is working normally(as I think) and with bug caused not by this function :)
Hello, roommate! I found a bug in your code. If you try to create stack witch size is too big you program will crash! Look at this code in main: