GUI Programming in C and C++

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

ankitdixit
Posts: 1
Joined: Wed Apr 15, 2020 11:58 am

GUI Programming in C and C++

Postby ankitdixit » Wed Apr 15, 2020 12:03 pm

Hello Everyone, Can anyone know which one is better C or C++ for compatibility with GUI programming? As my knowledge C has a GTK tool for enabling GUI programming and C++ has a QT tool for enabling GUI programming. But still, I am confused to choose the right one C or C++? Can anyone know this comparison? Please suggest some tips.

rohanjoshi0894
Posts: 1
Joined: Thu Apr 16, 2020 3:26 pm

Re: GUI Programming in C and C++

Postby rohanjoshi0894 » Thu Apr 16, 2020 3:28 pm

This is guaranteed to have nothing to do with the compiler. All compilers do is compile the code that they are given. What you're looking for is a GUI library, which you can write code against using any compiler that you want.

Of course, that being said, your first order of business should be to ditch Turbo C. That compiler is about 20 years old and continuing to use it isn't doing you any favors. You can't write modern GUI applications, as it will only produce 16-bit code. All modern operating systems are 32-bit, and many are now 64-bit. It's also worth noting that 64-bit editions of Windows will not run 16-bit applications natively. You'll need an emulator for that; it's not really going to engender much feeling of accomplishment if you can only write apps that work in a DOS emulator. :-)

Microsoft's Visual Studio Express C++ is available as a free download. It includes the same compiler available in the full version of the suite. The C++ package also compiles pure C code.

And since you're working in Windows, the Windows API is a natural choice. It allows you to write native Windows applications that have access to the full set of GUI controls. You'll find a nice tutorial here on writing WinAPI applications in C. If you choose to go with Visual Studio, it also includes boilerplate code for a blank WinAPI application that will get you up and running quickly.

If you really care about learning to do this, Charles Petzold's Programming Windows is the canonical resource of the subject, and definitely worth a read. The entire Windows API was written in C, and it's entirely possible to write full-featured Windows applications in C. You don't need any stinkin' C++.

That's the way I'd do it, at least. As the other answers suggest, GTK is also an option. But the applications it generates are just downright horrible-looking on Windows.

If you want to know the difference between C and C++, Just visit here.


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 5 guests