C++ Programming Tutorials : Create "Hello Steemians"steemCreated with Sketch.

in #utopian-io7 years ago (edited)

Hello everyone
Today i want to contribute in Utopian Categories Tutorial, tutorial i discussed is about C++ Programming with DevCpp.

Why Learn C++?
C++ is known to be a very powerful language. C++ allows you to have a lot of control as to how you use computer resources, so in the right hands its speed and ability to cheaply use resources should be able to surpass other languages. Thanks to C++'s performance, it is often used to develop game engines, games, and desktop apps. Many AAA title video games are built with C++.

Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as it's compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC based compiler.

Features are :

  • Support GCC-based compilers
  • Integrated debugging (using GDB)
  • Project Manager
  • Customizable syntax highlighting editor
  • Class Browser
  • Code Completion
  • Function listing
  • Profiling support
  • Quickly create Windows, console, static libraries and DLLs
  • Support of templates for creating your own project types
  • Makefile creation
  • Edit and compile Resource files
  • Tool Manager
  • Print support
  • Find and replace facilities
  • CVS support

The best way to learn a programming language is by writing programs. Typically, the first program beginners write is a program called "Hello Steemians", which simply prints "Hello Steemians" to your computer screen.

  1. Open Devcpp App, then create a new file by clicking the file menu --> New --> SourceFile.

  2. Add the sourcecode as below.
    #include <stdio.h>
    main()
    {
    printf("*****Hello Steemians*****\n");
    printf("Terimakasih telah membaca post saya\nSemoga bermanfaat");
    return 0;
    }

  3. After you finish writing your sourcecode, compile it by clicking the Execute menu and click Compile (F9).

  4. Save the file where you want and click save.

  5. if the compile process has been completed then in compile log it has the words "Compilation susseded in 5.99 seconds".

  6. After the compile then we run the application we have created by clicking the Execute menu and select Run (F10)

  7. Result

Let's examine this program line by line:

  1. #include <stdio.h> - Tells the compiler to include this header file for compilation.
  • What is a header file? They contain prototypes and other compiler/pre-processor directives. Prototypes are basic abstract function definitions. More on these later...
  • Some common header files are stdio.h, stdlib.h, unistd.h, math.h.
  1. int main ()
    This line initiates the declaration of a function. Essentially, a function is a group of code statements which are given a name: in this case, this gives the name "main" to the group of code statements that follow. Functions will be discussed in detail in a later chapter, but essentially, their definition is introduced with a succession of a type (int), a name (main) and a pair of parentheses (()), optionally including parameters.
  2. { and }
    The open brace ({) at line 5 indicates the beginning of main's function definition, and the closing brace (}) at line 7, indicates its end. Everything between these braces is the function's body that defines what happens when main is called. All functions use braces to indicate the beginning and end of their definitions.
  3. printf() This function is used to print the character, string, float, integer, octal and hexadecimal values onto the output screen

You can get this project (extention .cpp) on this link https://drive.google.com/open?id=1ErFHZXrQduQlOhhH-q0wFoCXaakhrgSi
ok hopefully usefull and good luck !

Sort:  

Coding it vital to a LOT of every day stuff!
This is awesome! :)
We can always use as many tutorials on as many things as possible!
There's always someone looking to learn something new! :)

I have resteemed this post! Thank you for following and supporting me! :)

- The Duchess

please, vote repeat

Upvoted @steemian-sniper
Want to be upvoted in the whole week ? check this link and you will be redirected
Five days left before the registration closes

DISCLAIMER: I was a robot who was programmed to target my followers, the creator does not share ANY opinions and thoughts explained by the author
Chao !