Learn C++ Programming

Total Blog Views: 54

Blog Status: publish

Created By: vishnu Created at: 08-11-2021

Tags: datatype basicprogramming coding programmer functions C++ Explore c

Programming Concepts

  • 1. How to solve Programming problem
  • 2.How a computer executes a program
  • 3. What is a "data type" and its fundamental role in writing a program
  • 4. The role of characters---the basic building blocks of all programs
  • 5. The concepts of constants and variables

 How to computer solve problem

Solving a problem on a computer involves the following activities:

  •    1. Define the problem
  •    2. Analyze the problem
  •    3. Devlop an algorithm(a method) for solving the problem
  •   4. Data and Variables

Introduction  of  C++

Structure of C++ Program :

 A C++ Program has four subparts as shown in block diagram . These subparts can be kept in different- different source files and after it can be compile separately or together.

Include file
Declaration of class
Defebition of member function
main() function

           Structure of C++ program

A simple program of C++

Program to print "Good morning" on output screen-

Program - A simple program of C++

#include<iostream>.h                             // include header file

using namespace std;                          //but you can replace #include<stdio>.h

int main()

{

            cout <<"Good morning ";            //print "Good morning"

            return0;

}

Output of above program will be-

Good Morning

 Features of C++ program

  • Just like C,C++ program is also collection of functions.
  • It is compulsory to write main() function in C++ programs.
  • In C++ program statements ends with semicolon (;) like C program.​

Comments- 

  1. (Double slash ) is used to write comments of a single line.       
  2. /*.....*/ is used to write comments of more than one line.​​

io stream file-

  1. The statements which has # sign are know as pre-processor directives.
  2. These are written at the starting of C++ program.
  3. Preprocessor procrss these statements before compilation of program.
  4. #include<iostream> - This statement add contents of iostream file to the content of program.
  5. In it cout identifier and insertion oprators are declared.

Namespace-

  1. It defines the scope of identifier used in a program.
  2. To use Namespace scope 'using namespace std' is written.
  3. 'std' is a namespace which is defined in standard class library of C++.

Compile and linking-

             Compiling and linking process depends upon operating system.

    Linux OS

  • ​      g++ command is used for compiling and linking of C++ program.
  •       Example- g++ abc.cpp.

This command compiles the program written in abc.cpp file. Compiler creates a object file abc.0 and which creates and executable file linking with library functions. Default executable file name is a.out.

   


vishnu

I'm doing Collage Study Right Now and Make Blog About information technology & Info. Programming Share my blogs and comment on it Give me more suggestion on it!



Comments



  • swazahmad | almost 4 years ago
    Awesome Information Thanks For Sharing
    • vishnu | almost 4 years ago
      Thanks for supporting
Buy traffic for your website

About Shadbox

we have the “Get things executed” lifestyle at our place of work. There are not any excuses, no if’s or however’s in our dictionary. committed to navigating the ship of creativity to create cell answers, we resolve the real-lifestyles troubles of our clients and their clients. Our passion for work has won us many awards, year after 12 months.

Services

Downloads