👉coz paper can’t convert instructions into fruitful applications 👈
Everyone start their blog with a either a dumb story which never happened with them or a bad ass topic which is already famous but tasting things which were never famous or relevant to common people is another challenge in a true Blogger’s life,so i am starting my blog with a topic related to programming and tranfering my knowledge on C++ to people with brief definitions.
If you are interested in learning C++, here are the best and most important topics to start with.. 👇 👇
First lets catch up some topics related to programming, Starting with what are data structures & objects, then coming to libraries and ending this session with the uses of C++ in solving real world problems.
- Variables 👉 Variables are data types,which help us to store our data in memory easily for example: int for integers,char for character & float for decimal values etc… NOTE: VARIABLES ARE DATA TYPES WITHOUT INSTRUCTIONS.
- Data structures 👉 Data structures are the formats or types by which we can store data in memory so that we can have accessibility to the data using some instructions,for example array is defined like this int mannu[n]; and can be accessed this way mannu; means we are focusing on the 10th data of our array (9th index).
- Object 👉 In my understanding,object can be variables,data structure,a function or a space in memory possibly referenced by an identifier(pointer). NOTE:: EVERYTHING IN PROGRAMMING IS AN OBJECT.
- Libraries 👉 libraries are the group of object files linked to each other with the help of linker and then saved in the directory where system libraries are searched.There are 2 types of libraries static and dynamic and professionals use dynamic libraries more.
- There are many ways by which we can solve real life problems using C & C++ like using openCV we can create stuff where image processing is used and using GTK & QT we can create GUI applications.
Now starting the 7 topics to focus on ⏬
🔥 Classes V/S structs 👉 structs was introduced in C language and is the champion of all the data structures,it can store different data types all together and most importantly structs is without functions but classes includes functions too, means we can store data+instructions+functions in a class.
🔥 Inheritance 👉 Taking an example: When your father buys some property and after some years all his property is passed to his heir(son)this same thing is followed for years and years,same concept is in C++ we here make a parent class and then a inherited class is made,which can use all the members of the parent class.NOTE 👉👉 daughter class must be a type of parent class example:: car is type of vehicle,plateau is a type of land so here land and vehicles are parent classes and car and plateau are daughter classes.
🔥 Now coming to members of the classes,common things like (tyres,color,capacity)these things must be the members of parent class vehicle.Daughter class(car) consist members (like string engine,bool spare_tyres)which are not common in all vehicles cause many vehicles are not provided with spare tyres and other vehicles can have electric, petrol or diesel engine.
🔥 colon ‘:’ is used to make a class inherited to another,as you can see ‘:’ is used to inherit a new class from a predefined class.
🔥 what is using namespace ?? when we start to code a program we write include <iostream> which is a standard library of C++ which includes all the stuff related to input and output, and after that we type using namespace std which means import all the standard functions to be used,in C++ you can create your own library instead of using standard library.
If you don’t write using namespace std whenever you will use cin or cout you have to write std::cin or std::cout ,here this double colon ‘::’ is used when we to access a method from a class,methods are the functions present in class itself.
🔥 Vector 👉 As we know that array is a data structure with continuous memory stacks but dynamic allocation is not allowed in array right? that’s why the creator of C++ came up with an idea of creating Vector, where we can dynamically store data.Vector is a same as array but with dynamic memory allocation.
🔥 Encapsulation 👉 Basically encapsulation is a technique by which we can evoke the access to other functions or grant permissions to access data to some functions and classes.
private 👉 In private division only members of the same class can access the other members.No other function can access the class with private data.
public 👉 In public every other function can access public class data.
protected 👉 Only inherited classes can use the protected data.
🔥 As we all know that C is the best computer language to learn and you can use C in C++ also by including this, #include <stdio> and #include <stdlib> NOTE 👉 without .h extension.
That’s enough to master all the concepts in C++ and try creating and learning openCV and GTK or QT.