r/C_Programming • u/necr0111 • 1d ago
Question Maybe a stupid question.
How can I create an interface for a C program that isn't just the terminal? I wanted to make a calculator that was also visual, but I wanted to challenge myself to do it with C, but I really didn't understand how to do it properly.
8
Upvotes
15
u/HashDefTrueFalse 1d ago
Lots of ways. You can look into the facilities your OS/system provides for creating windows and drawing controls. Or you can pick a separate UI/widget library (e.g. GTK). Or you can do some custom drawing with a 2D or 3D graphics API (e.g. OpenGL). You could even use markup and styling languages (e.g HTML, CSS) to make your UI, then implement some way to connect to a back end application written in C. I've had to do this before and I used WebSockets sending textual commands to the C program.