Solved

Good C++ Book

Posted on 2001-07-28
6
226 Views
Last Modified: 2010-04-21
Hi,
I've programmed C++ (with MFC) for Windows for about 2 years, but now I'm making the switch to Linux. I'm looking for a good book that could teach me how to program C++ for Linux.
0
Comment
Question by:zxcvzxcv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:XTerm
ID: 6331181
Well, the ANSI C++ si exactly the same, but MFC does not exist in Linux. I recommend (since you know MFC) to buy a book on QT.
0
 
LVL 1

Author Comment

by:zxcvzxcv
ID: 6332218
To run certain KDE apps I've noticed that I needed to get certain QT versions, and libraries, what exactly is QT?
0
 
LVL 2

Accepted Solution

by:
XTerm earned 25 total points
ID: 6333489
Qt is a platform independant extension of C++. It does basically the same as MFC,but it has some great advantages over MFC. For example, Qt runs on all platforms who have g++, then GNU c++ compiler. (That are almost all Unixes, MacOS X, and windows can compile Qt as well.) A Qt program written in linux, will compile and run on windows and on Mac, a program written on a Mac, wil compile and run on windows and linux etc etc. That means you write one program, and you target almost everybody as a potential clinet.
Another benefit is its extreme power and ease of use. You dont have to write all that shitty code in capital if you know what i mean, that just wastes time and has no programming benefit.
The hello world example (compare this code to the MFC hellow world adn you'll be convinced :))

#include <qapplication.h>
#include <qlabel.h>

int main(int argc,char **argv)
{
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:XTerm
ID: 6333521
Ow, Sorry, I was copying some files, and my system gets very laggy then, accidents happen
Here is the example...

#include <qapplication.h>
#include <qlabel.h>

int main(int argc,char **argv)
{  
   QApplication *app = new QApplication(argc,argv);
   QLabel *l = new QLabel("Hello world",0,0);
   app->setMainWidget(l);
   l->show();
   app->exec();
   delete app();
   return(0);
}

Voila that's it. KDE has a wonderfull program named KDevelop, it's an C++ IDE that I believe is better than the VC++6 IDE. Qt 's events are handeld through signals and slots. For example you can connect a button's click signal to a function. It's done with one line of code. Very easy. Qt comes with excellent documentation in HTML or PDF.

www.trolltech.com

Cheers
0
 
LVL 2

Expert Comment

by:XTerm
ID: 6333538
One must-have C++ book is "The C++ Programming Language" from Bjarne Stroustrup. The one I got is from Addison Wesley. An excellent book, but not intended for newbies.
For Qt I got "Qt programming for Linux and Windows 2000" from Patrick Ward, Published by Hewlett Packard??Professional Books.

Cheers again
0
 
LVL 1

Author Comment

by:zxcvzxcv
ID: 6336732
thank you very much!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question