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
View all comments
Show parent comment
0
u/knouqs Feb 18 '26 edited Feb 18 '26
Ah, OK. I know I've had to be explicit in my code. New compilers versus old, maybe? Debug versus release? I remember getting warnings.
I proved it to myself also. Thanks for the comment.
For anyone in the future who wants to try this at home, I wrote a simple program.
Then, compiled with gcc and run with valgrind and memcheck.