LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   is a visual C++ tutorial good for a linux user? (http://www.linuxquestions.org/questions/programming-9/is-a-visual-c-tutorial-good-for-a-linux-user-903042/)

joham34 09-14-2011 03:34 PM

is a visual C++ tutorial good for a linux user?
 
Hello everybody.
I plan to start reading about C++ and a friend of mine gave me printed the tutorial "Visual C++ in 21 days"
I use Linux exclusively and would like to use C++ to make some programs for personal use.
So I wonder : Is this book proper for me ( since Visual C++ is developed by MS and I am a Linux user ) or should I print another tutorial ?
Thanks in advance

ta0kira 09-14-2011 05:16 PM

You should avoid all IDE-oriented C and C++ introductory tutorials. They'll be counter-productive in Linux, even if the IDE is available in Linux. You need to have a good understanding of the build process from the command line and from the makefile system to be a successful C/C++ programmer in Linux.
Kevin Barry

markush 09-14-2011 05:35 PM

Hi,

there are several C++ tutorials in the internet, vor example this one: click here so there is no need for a M$-book
You may search with google. It is a good idea to find some exercises with solutions or start a small project, because only the theory will not help much. You will also find exercises in the internet click here.
Maybe this is a little bit off topic in this thread, but I have learned much at project euler http://projecteuler.net/index.php?section=about

Markus

joham34 09-14-2011 10:10 PM

Quote:

Originally Posted by markush (Post 4471895)
Hi,

there are several C++ tutorials in the internet, vor example this one: click here so there is no need for a M$-book
You may search with google. It is a good idea to find some exercises with solutions or start a small project, because only the theory will not help much. You will also find exercises in the internet click here.
Maybe this is a little bit off topic in this thread, but I have learned much at project euler http://projecteuler.net/index.php?section=about

Markus

Thank you for your answer. Ill do as you suggested. I already downloaded the tutorial you suggested. I consider my question is answered and marked thread as solved.
One last question. Say you write a C++ program in a Linux machine and you want later to run it in a Windows machine. Will you have to change the source code or since you can compile it with g++; you can compile it with a Windows compiler without changes?

markush 09-15-2011 01:33 AM

Quote:

Originally Posted by joham34 (Post 4472042)
One last question. Say you write a C++ program in a Linux machine and you want later to run it in a Windows machine. Will you have to change the source code or since you can compile it with g++; you can compile it with a Windows compiler without changes?

That depends on the functions you use. If you're program uses systemspecific functions you'll very likely have to adapt the sourcecode when you want to compile it on another system.
But for most of the beginner-exercises this is not necessary.

You may take a look at the C++ (or C respectively) Standard-library. I'd assume that this functions are independent of the Operatingsystem (for the user/programmer, internally they are of course different for Windows and Linux).

Markus

merlinblack 09-15-2011 04:30 PM

That Visual C++ in 21 days is most likely fine for learning C++ on Linux. If it is any good, the IDE stuff will be kept to a minimum, and the rest should be by nature of being introductory, cross platform.

Also a good way to learn is too set yourself a task to complete. If your new to programming perhaps a simple 'guess the number, saying warmer or colder' game.

I've been programming for years, so I get up to speed on a new language by making a program to solve Sudoku puzzles.

Happy coding!

bobclemmons 09-15-2011 04:53 PM

Brucek Eckel has a great book available free online for learning c++ and having example programs that can be built using gcc or in Windows.

http://www.mindview.net/Books/TICPP/...ngInCPP2e.html

psionl0 09-15-2011 09:41 PM

Quote:

Originally Posted by merlinblack (Post 4472842)
I've been programming for years, so I get up to speed on a new language by making a program to solve Sudoku puzzles.

You too?

I would love to compare algorithms.

area124 09-15-2011 10:57 PM

A good C++ book
 
My favorite text is "C++ How to Program" by Deitel & Deitel. I think I must have at lease two editions on my shelf. I is a very good reference as well as teaching text. The only downside is it is a little pricey.


All times are GMT -5. The time now is 01:44 PM.