Posts

Call by value and by reference in function

Image
               Functions in C++ Hello! Everyone in previous blog we learned about function and in today’s blog we will continue previous blog that means we will learn about use of function using call by value and call by reference. What is call by value? basically what we do when we awoke a function we provide value or argument to process with, in the same way we can provide these value to function by these two method. 1.Call by value method 2.Call by reference method 1. Call by value method In the call by value method, the original value can not be changed. When you pass any argument to function, it is stored locally by the function parameter in memory called stack memory. Hence, the values are changed inside the function only and it will not have an effect outside the function.   Here I am giving you an example of swapping two number by call by value by which you can understand this concept better. Example- #include <io...

Functions in C++

  Functions in C++ Hello! Everyone in the previous blog we have discussed about classes and object in c++ and how to create and how to access these classes and its member function. But in this tutorial we will discuss about function and its overloading in c++ What is function? As you listened word function and overloading of function first question that will come to your mind that what is this function and why we are studying This. So i am giving few points about function, so that you can get some idea about function: 1.function is a Self contained block of statements that performs that performs a coherent task of some kind. 2.Every C++ program can be thought of the collection of functions. 3.main() is also a function. Type of functions There are mainly two type of functions in c++. 1.Library function 2.user defined functions: that means programmer can create their own function to perform a specific task. Uses of functions 1.Writting functions avoids rewri...

Classes and Object in C++

Image
  Classes and object in c++ Hello! Everyone in the previous tutorial we have learned about object orientation of c++, in this tutorial we will learn about classes in c++ and how to create class and how we deal with it. SMART ENGINEERS What Is class? A class is a user define data type which holds both data and function. The data included in the class i.e the internal data is called data member and the functions included is called the member function. these member function can manipulate the internal data of the class. A class definition starts with the keyword class followed by the class name; and the class body, enclosed by a pair of curly braces. A class definition must be followed either by a semicolon or a list of declarations. For example, we defined the Box data type using the keyword class as follows:- class Box {    public:       double length;       // Length of a box       dou...

OOPs concept of C++ programming

Image
C++ OOPs concept Hello! In the previous blog we learned some basic terminology of C++, but in this blog we are going to learn the object orientation concept of C++ for which this language is famous.so let’s get started. The major purpose of C++ programming is to introduce the concept of object orientation to the C programming language. OOPs is a paradigm that provides us many concepts such as inheritance, data binding, polymorphism etc. SMART ENGINEERS Object -orientation Object orientation is basically a thinking methodology which describe following points. 1 .Everything is an object. 2 .Any system is composed of object (a system is also an object). 3 .The evolution and development of a system is caused by the interactions of the objects inside/outside a system. Everything is an object Any entity that has state and behaviour is known as object.    1 .A student, a professor    2 .A desk, a chair, a classroom, a building    3 .A univers...

Introduction to c++

Image
   Introduction to c++ Hello! everyone I hope you all are doing great in this period. In the previous tutorials we have learned about c language, and we covered all important topics related to c language. Now we will learn c++ language and important topics related to c++. SMART ENGINEERS What is c++ ? C++ is a general-purpose programming language that was developed as an enhancement of the C language to include object-oriented paradigm.it is an imperative and a compiled language. Some of the features & key-points to note about the programming language are as follows: Simple:- It is a simple language in the sense that programs can be broken down into logical units and parts, has a rich library support and a variety of data-types. Machine Independent:- A C++ executable is not platform-independent (compiled programs on Linux won’t run on Windows), however they are machine independent. Mid-level language:- It is a mid-level language as we can do both systems-p...