I've been wondering... I'm more of a VB programmer than I am a C programmer, which is why you don't see me floating around in those forums very often...
but the thought occured to me the other day, that VB is a completely interface, event driven programming language, while C... is more of a prompt type interface, from my experience with it.
So the question is, since I've never seen/designed one, what kind of UI do you build with C/C++... or is it more programming that is built around one function, that you run, and that's it, like it doesn't need further interaction from the user?
And if you do make a visual interface, how do you do it?
Well it's completely different in Linux and Windows. In Windows you use the WinAPI or MFC, and in linux you use...well, I have no clue.
Yes, C is a procedural language, but you can still make Event-Driven UI's in it because (at least in WinAPI) the OS sends messages to the application, and when you intercept those messages, you take whatever action is neccessary...ex:
Every time you get a WM_SIZE message you will most likely want to resize all of the controls on your window, so you catch that message and resize all of the controls during it.
The simplest working Windows UI app I can think of would be:
I wrote a tutorial on it a while ago if you'd like the link...
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam,
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR pszCmdLine, int nCmdShow)
wc.style=CS_HREDRAW | CS_VREDRAW;
hwnd=CreateWindowEx(0, "TutClass", "Hi!",
NULL, NULL, hInstance, NULL);
while(GetMessage(&msg, 0, 0, 0))
LRESULT WINAPI WndProc(HWND hwnd, UINT uMsg, WPARAM wParam,
hdc = BeginPaint(hwnd, &ps);
TextOut(hdc, 0, 0, "Hello, World!", 13);
return DefWindowProc(hwnd, uMsg, wParam,lParam);
sure... hook me up, i'd be interested in reading about it... not that I'm probably going to go anywhere with it, but I'm interested.
Can't hurt to learn something new! :)