flâneur — a map of the web's best reading

1.4. Let’s look at a C++ program — C++ for Python Programmers

runestone.academy · 2,450 words · saved by 1 readers

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