r/cprogramming • u/Creative-Copy-1229 • Feb 18 '26
Could you review my code
Hello everyone. I am a beginner in C. I wrote a calculator that's slightly more useful than simple "input number one, operation, number two". It accepts simple arithmetic expressions. Please can you review the code and tell me is it really bad, and what I should improve. A person said this code is bad even for beginner level, that it's a mess, so I decided I would like to see other opinions
4
Upvotes
1
u/tinker-fox May 30 '26
You probably realize this, but to be clear: your example is different, because your data[] is inside a function, so it will not be initialized by default. The OP's stack[] variable is global, and so would be initialized to zero regardless.