How to Write Standard Code in C++

Download a C++ IDE (integrated development environment) such as Eclipse, Netbeans, and CodeBlocks, or you can use a plain text editor such as Notepad++ or VIM., Create a main program file., Begin writing your program., Insert comments in your code...

10 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Download a C++ IDE (integrated development environment) such as Eclipse

    You can also run programs from the command line, in that case any text-editor will suffice.

    It might be handy to choose an editor which supports syntax highlighting and line-numbers.

    Most programmers find that unix-like systems (linux, OS X, BSD) are the best environments for development.
  2. Step 2: Netbeans

    The main file must include a function called main().

    This is where execution of the program begins.

    From here, you should be calling functions, instantiating classes, etc.

    Other files of your application as well as libraries can be included into this file. , Insert your code or the program that you need to build (see below for a few examples).

    Learn the syntax, semantics, Object-Oriented Programming paradigms, data striations, algorithm designs such as linked lists, priority queues, etc.

    C++ is not an easy language to program in, but doing so teaches you the fundamentals that extend to all programming languages. , Explain what your functions do and what variables are for.

    Choose clear names for variables and functions.

    Capitalize the names of global variables.

    In general: make sure that anyone reading your code can understand it. , Again, see the examples below. ,,
  3. Step 3: and CodeBlocks

  4. Step 4: or you can use a plain text editor such as Notepad++ or VIM.

  5. Step 5: Create a main program file.

  6. Step 6: Begin writing your program.

  7. Step 7: Insert comments in your code.

  8. Step 8: Use proper indenting in your code.

  9. Step 9: Compile your code with g++ main.cpp

  10. Step 10: Run your program by typing: ./a.out

Detailed Guide

You can also run programs from the command line, in that case any text-editor will suffice.

It might be handy to choose an editor which supports syntax highlighting and line-numbers.

Most programmers find that unix-like systems (linux, OS X, BSD) are the best environments for development.

The main file must include a function called main().

This is where execution of the program begins.

From here, you should be calling functions, instantiating classes, etc.

Other files of your application as well as libraries can be included into this file. , Insert your code or the program that you need to build (see below for a few examples).

Learn the syntax, semantics, Object-Oriented Programming paradigms, data striations, algorithm designs such as linked lists, priority queues, etc.

C++ is not an easy language to program in, but doing so teaches you the fundamentals that extend to all programming languages. , Explain what your functions do and what variables are for.

Choose clear names for variables and functions.

Capitalize the names of global variables.

In general: make sure that anyone reading your code can understand it. , Again, see the examples below. ,,

About the Author

N

Nicholas James

Professional writer focused on creating easy-to-follow practical skills tutorials.

42 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: