Hi guys today I got a c++ book from my teacher and it looks like all the examples are for windows. I havent a lot of time to look through it yet. If they do work how do I compile and run it. The book is 'Sams teach Yourself c++ in 21 days"
Hi guys today I got a c++ book from my teacher and it looks like all the examples are for windows. I havent a lot of time to look through it yet. If they do work how do I compile and run it. The book is 'Sams teach Yourself c++ in 21 days"
not that i know didly about c++ - but most the stuff should work fine under linux with gcc
[quote author=pbharris link=board=9;threadid=7821;start=0#msg71480 date=1064641063]
[...] but most the stuff should work fine under linux with gcc
[/quote]
Note that you need to compile C++ programs with "g++", not with "gcc", though both are part of "gcc", in the meaning of "GNU Compiler Collection".
Grab an O'rielly programming book. Most other books will be aimed towards Windows, and will have code for Windows that doesn't like UNIX.
I would like to get another book but I have no money unless I can find a place to get it used.
Bruce Eckel has a really good C++ book which can be read online or downloaded for free. His books get good reviews and he's also a big believer in open souce
The ulr is http://www.mindview.net/Books
http://mindview.net/Books/TICPP/ThinkingInCPP2e.html
I'm a sicko, I really like the explanations in Sam's Teach yourself C++ for Linux in 21 days.
But then again.. I'm a very dumb guy when it comes to coding.
What kind of topics are covered? If you're going to learn C++ in 21 days, chances are pretty slim that you'll start getting into the OS-specific stuff. Every single program I ever wrote in my first year programming class compiled and ran under linux and windows, and that's a 4 month course. You may have to change the names of some includes, but really most changes should be trivial.
[quote author=Tyr_7BE link=board=9;threadid=7821;start=0#msg75823 date=1072418631]
What kind of topics are covered? If you're going to learn C++ in 21 days, chances are pretty slim that you'll start getting into the OS-specific stuff. Every single program I ever wrote in my first year programming class compiled and ran under linux and windows, and that's a 4 month course. You may have to change the names of some includes, but really most changes should be trivial.
[/quote]
In my book, the programs should compile and run under Windows as well (unless they note that otherwise - mostly for programs that crash on Windows). It doesn't get OS specific untill after day 21 (there's an extra week with Linux stuff - not counted in the title to comform to SAMs standard titles)
I learned from Sams Teach Yourself C++ in 21 days as well. I think I turned out to be a decent coder for the time I've put into it... heck, I'm developing a MUD.
It proved to be a decent text with the help of the unix man pages, google and about a year of my patience.
If I could go back (I wouldn't!) I'd probably learn from Thinking in C++ or an O'Reilly text, but Jessy Liberty done a fine job anyhow. Actually, I'm reading Thinking in C++ on occasion anyhow. It's a very enlightening (and free) e-book!
Everything in STYC++I21D (ever feel like creating random acronyms? ;D) will compile with G++.
Bookmarks