Learn C++ Programming: Tutorials, Books & Notes for Beginners

  • Context: C/C++ 
  • Thread starter Thread starter rotphi
  • Start date Start date
  • Tags Tags
    C++
Click For Summary

Discussion Overview

The discussion revolves around resources for learning C++ programming, particularly for applications in numerical mathematics and simulations. Participants share recommendations for tutorials, books, and practical approaches to enhance their understanding of C++.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant suggests starting with the basics and then exploring the Standard Template Library (STL) and BOOST for more advanced features.
  • Another participant recommends practical experience by writing small programs alongside learning, emphasizing the availability of free C++ compilers in Linux distributions.
  • A participant mentions "Numerical Recipes in C++" by William H. Press, noting that while it is a fast-paced book, it serves as a useful cookbook for numerical techniques.
  • Concerns are raised about the coding style in "Numerical Recipes in C++," with some participants arguing that it is not a good example of C++ programming practices.
  • One participant shares a link to a tutorial on gravitational simulations, indicating a personal interest in numerical simulations.
  • Another participant mentions an online resource for computational physics that is not in C++, but may still be of interest.

Areas of Agreement / Disagreement

Participants express a variety of opinions on the quality and style of different C++ resources, particularly regarding "Numerical Recipes in C++." There is no consensus on the best approach to learning C++ or the most effective resources, indicating multiple competing views.

Contextual Notes

Some participants highlight limitations in the coding style of certain resources, and there are mentions of varying experiences with different tutorials and books. The discussion reflects differing levels of familiarity with C++ and its applications in numerical mathematics.

Who May Find This Useful

Undergraduate students in physics or computer science, individuals interested in numerical simulations, and those seeking resources for learning C++ programming.

rotphi
Messages
4
Reaction score
0
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/"
 
Last edited by a moderator:
Technology news on Phys.org
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.
 
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
 
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.
 
rotphi said:
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
 
mgb_phys said:
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.
 
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: https://www.physicsforums.com/showthread.php?t=402565

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

Hope its helpful!
 

Similar threads

Replies
69
Views
11K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 8 ·
Replies
8
Views
14K
  • · Replies 25 ·
Replies
25
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
5
Views
8K