Introduction to C++ - Learn C++ , C++ Tutorial , C++ programming



 c++ images
Learn C++ , C++ Tutorial , C++ programming - C++ Language -Cplusplus

Introduction to C++

  • This guide answers all your questions related to C++ on what is it, when is it used, why is it used and how to get yourself started with it.
  • C++ is an object-oriented programming language. It is an extension to C programming.
  • C++ ranks 4th in popularity according to 2016 IEEE spectrum Top Programming Language ranking. Learning C++ is a wise investment for all pr ogrammers.
  • C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
  • This reference will take you through simple and practical approach whilelearning C++ Programming language
learn c++ -  c++ tutorial -  c++ development tutorial -  c++ examples -  c++  -  c++ script -  c++ program -  c++ download -  c++ samples  -  c++ scripts

Introduction to development

  • Before we can write and execute our first program, we need to understand in more detail how C++ programs get developed. Here is a graphic outlining a simplistic approach:
 c++ development

Step 1: Define the problem that you would like to solve.

  • This is the “what” step, where you figure out what you are going to solve.
  • Coming up with the initial idea for what you would like to program can be the easiest step, or the hardest. But conceptually, it is the simplest.
  • All you need is an idea that can be well defined, and you’re ready for the next step.

Step 2: Determine how you are going to solve the problem.

  • This is the “how” step, where you determine how you are going to solve the problem you came up with in step 1.
  • It is also the step that is most neglected in software development. The crux of the issue is that there are many ways to solve a problem -- however, some of these solutions are good and some of them are bad.
  • Too often, a programmer will get an idea, sit down, and immediately start coding a solution. This often generates a solution that falls into the bad category.
  • We’ll talk more about how to effectively design solutions to problems in a future lesson.
Learn C++ , C++ Tutorial , C++ programming - C++ Language -Cplusplus

Step 3: Write the program

  • we need two things: First we need knowledge of a programming language, we need an editor.
  • It’s possible to write a program using any editor you want, even something as simple as Window’s notepad or Unix’s vi or pico.
  • However, we strongly urge you to use an editor that is designed for coding. Don’t worry if you don’t have one yet. We’ll cover how to install one soon.
  • Also note that many complex C++ programs have multiple .cpp files.
  • Although most of the programs you will be creating initially will only have a single .cpp file, it is possible to write single programs that have tens if not hundreds of individual .cpp files.

Step 4: Compiling

  • In order to compile a program, we need a program called a compiler. The job of the compiler is twofold:
  • To check your program and make sure it follows the rules of the C++ language. If it does not, the compiler will give you an error to help pinpoint what needs fixing.
  • To convert each file of source code into a machine language file called an object file. Object files are typically named name.o or name.obj, where name is the same name as the .cpp file it was produced from. If your program had 5 .cpp files, the compiler would generate 5 object files.
 c++ compile

Step 5: Linking

  • Linking is the process of taking all the object files generated by the compiler and combining them into a single executable program that you can run.
  • This is done by a program called the linker.
 c++ link
  • Once the linker is finished linking all the object files (assuming all goes well), you will have an executable file.
Learn C++ , C++ Tutorial , C++ programming - C++ Language -Cplusplus

Step 6: Testing and Debugging

  • You are able to run your executable and see whether it produces the output you were expecting.
  • If not, then it’s time for some debugging. We will discuss debugging in more detail soon.
  • Note that steps 3, 4, 5, and 6 all involve software. While you can use separate programs for each of these functions, a software package known as an integrated development environment (IDE) bundles and integrates all of these features together.
  • We will talk more about installing and using IDEs in the next section.
learn c++ -  c++ tutorial -  c++ development tutorial -  c++ examples -  c++  -  c++ script -  c++ program -  c++ download -  c++ samples  -  c++ scripts

Related Searches to Introduction to C++