1.4. Let’s look at a C++ program — C++ for Python Programmers
A time honored tradition in computer science is to write a program called “hello world.” The “hello world” program is simple and easy. No logic errors are possible to make, so getting it to run relies only on understanding the syntax. Let’s look at an easy version of “hello world” in Python: Activity: 1.4.1 ActiveCode (hellopysimp) Now, lets look at a more “complicated” version of the “hello world” program with a main function in Python: Activity: 1.4.2 ActiveCode (hellopymain) Next, lets look at the same program written in C++: Activity: 1.4.3 ActiveCode (hellocppstd) The above program can alternatively be written as follows to allow better facilitate standard input and output: Activity: 1.4.4 ActiveCode (hellocppnamespace) What we see is that at the core there are a few similarities with the complicated Python version, such as the main function and the string “Hello world”. However, in C++ there is a lot more stuff around the edges that make it harder to see the core of the program.
1.4. Let’s look at a C++ program — C++ for Python Programmers cpp4python Search Table of Contents Book Index User Course Home Assignments Practice Peer Instruction (Instructor) Peer Instruction (Student) Change Course Instructor Dashboard Progress Page Edit Profile Register Login Dark Mode Scratch ActiveCode --> --> Scratch Activecode --> Help FAQ Instructors Guide About Runestone Report A Problem This Chapter 1.1 Welcome to C++ for Python Programmers 1.2 Introduction 1.3 Why Learn Another Programming Language? 1.4 Let’s look at a C++ program 1.7 Glossary 1.3. Why Learn Another Programmi
Explore this link on the map →related reading
- CS106B C++ Fundamentalsweb.stanford.edu
- Learn C++ – Skill up with our free tutorialslearncpp.com
- CS106B C++ Stringsweb.stanford.edu
- how I think when I think about programming - alice mazalicemaz.com
- Ray Tracing in One Weekendraytracing.github.io
- Google C++ Style Guidegoogle.github.io
- C/C++ data types, basic operators, and control structurescourses.washington.edu
- Notes on Data Structures and Programming Techniques (CPSC 223, Spring 2022)cs.yale.edu
- Effortless Performance Improvements in C++ | Julien Jorge's Personal Websitejulien.jorge.st
- Hello, World! - The Rust Programming Languagedoc.rust-lang.org
- Writing a C compiler in 500 lines of Pythonvgel.me
- Python基本語法 - HackMDhackmd.io