PDA

View Full Version : How to go on with C++


rotphi
May1-10, 07:58 AM
Hello!
I just finished reading the C++ tutorial on cplusplus.com that is a very basic introduction into variables, constants, control structures, compound data types and some object-oriented elements. Now I want to go on and I am looking for some good tutorials, books or lecture notes.
I am a physics undergraduate student (3rd year) and want to do something like numerical mathematics with C++.
Any recommondations?

Thank you and have a good weekend,

rotphi

Link to the C++ tutorial on cplusplus.com:
http://www.cplusplus.com/doc/tutorial/

mgb_phys
May1-10, 09:50 AM
Ask on stackoverflow.com (or better still search the answers)

I would say just use it, C++ is a very large language - too large to just sit down and learn before you start. You know the basics, there are a couple of other things you should know -look at the STL (for vectors, arrays, algorithms) and BOOST (for everythign not int he standard library)
A lot of new programmers ignore these because they are complicated 9they are but the tutorials on cplusplus help) but it's better to invest soem time in learnign them than waste months getting 'C' style arrays to work.

rotphi
May8-10, 11:10 AM
Thank you, this was really helpful.
I am now into "Numerical recipes on C++" by William H. Press but this book is very fast forward. I also read a bit about the GNU Scientific Library to get a better overview on this topic.
Are there any more suggestions?

rotphi

Antiphon
May8-10, 11:46 AM
Get a c++ compiler and write little programs as you read. You will learn much faster that way. Free c++ compiler is in any Linux distribution.

jtbell
May8-10, 08:25 PM
For learning how to use the standard library containers (vectors etc.) effectively, I highly recommend the book "Accelerated C++" by Koenig and Moo (http://www.amazon.com/Accelerated-C-Practical-Programming-Example/dp/020170353X/ref=sr_1_1?ie=UTF8&s=books&qid=1273368258&sr=1-1).

mgb_phys
May9-10, 12:12 AM
I am now into "Numerical recipes on C++" by William H. Press but this book is very fast forward
It's an ok cookbook for some numerical techniques (although a lot of scientific programmers hate it = it teach you just enough to be dangerous)
But it's a terrible example of c++ code, it's basically pascal transated to fortran then translated to c then translated to c++, the routines mostly work but it's not a good style to learn from

jtbell
May9-10, 01:53 AM
it's basically pascal transated to fortran then translated to c then translated to c++

IIRC the Fortran version came first, then Pascal. I remember reading comments about the style being awkward for Pascal because they made as few changes as possible in "translating" from Fortran.

Sagekilla
May11-10, 03:00 PM
I'm a second year undergraduate in Physics and Computer Science, going into my third year. And like you, I have an interest in numerical simulations. I just posted a small tutorial on a basic numerical simulation of gravity.

If they haven't moved it yet, (I posted it in the wrong forum by accident), here's the link: http://www.physicsforums.com/showthread.php?t=402565

Otherwise, it should be under this sub forum as "Intro to Gravitational Simulations"

Hope its helpful!

Edgardo
May12-10, 07:32 AM
Not in C++ but in C: An introduction to computational physics (http://farside.ph.utexas.edu/teaching/329/329.html) (online material by Richard Fitzpatrick).