C plus or C++ Tutorial for beginners

Updated:15/march/2023 by Computer Hope

C++ closely models rear world problem solving approach.C++ based on model of Object-Oriented Programming System.C++ is a methodology or paradigm to design a program using classes and objects. It simplifies software development and maintenance by providing some concepts: Object. Class. Inheritance

C++ is object oriented language.in C++ default return “integer”. In class of C++ data + functions accessing those data are member of class and All member of class are private by default.

The main differently within the computer memory. A variable is a named location in memory that is used to hold A value that may be modified by program. All variable have to declare before they can be used.
History of C++ programing language:
  • Year : 1982
  • Developed By : Bjarne stroustrap
  • Lab: Bell Labs
  • Company: At & T

How to Write C++ program

  • int main() The main() function is the entry point of every program in c language.
  • printf() The printf() function is used to print data on the console.
  • Return type of main () function: The return type for main () function should always be int.
  • Header in c program ,program we have used stdio.h. we use several keywords & statements and functions such as printf(), scanf() etc.
  • Take input from the user scanf function is used to take the input from the user.

C++ Comments

Similarly with c or java, you can write comments in python.Begin your sentence with "/*" and end it with "*/". Although using comments is not required, it is nevertheless a good practise because it makes the code easier to read. A programme may have many comments.

Why is C++ language Used in development ?

The C language is a high-level, general-purpose programming language. It provides a straightforward, consistent, powerful interface for programming systems.

What is a c++ langauge feature?

  • work on OPPS concept
  • Simple and Efficient. The basic syntax style of implementing C language is very simple and easy to learn. ...
  • Fast.
  • Portability.
  • Extensibility.
  • Function-Rich Libraries.
  • Dynamic Memory Management.
  • Modularity With Structured Language.
  • Mid-Level Programming Language.

Below is an example of a basic   C++   that would print that you are eligible for driving licence.

class add
	{
		int a, b, c;
		public :
 void get( );
			void sum( );
			void show( );
	};
void add : : get ( )
{
	cout << “Enter a no”;
	cin >> a >>b;
}
void add : : sum( )
{
	c= a+b;
}
void add : : show( )
{
	cout << “Numbers are = “<< a << “ “ << b;
	cout << “sum =” <<c;
}
void main( )
{
	add obj;
	obj. get( );
	obj.sum( );
	obj. show( );
	getch( );
}

Mandatory Tools you will need to install before work on C++ / Cplus language.

  • you will need a Pentium 200-MHz computer with a minimum of 128 MB of RAM
  • Linux 7.1 or Windows 95/98/2000/XP operating system.
  • Download Turbo C++ 3.2 from here
  • Step 2If any previous version of "Turbo C++" install on your computer, then first of all uninstall that.
  • Step 3Extract downloaded "Turbo C++ 3.2.zip" file.
  • Step 4Run the "setup.exe" file.
  • Step 5Follow the setup instructions.
  • Step 6If any error occurs, please check the solution of common Turbo C++ issues here.

Latest Technical Post