Posts

Showing posts from October, 2021

Difference c & Cpp

  Since C is a procedural programming, it is a function driven language. C++ is an object driven language. In C, functions cannot be defined inside structures In C++, functions can be used inside a structure. C uses functions for input/output. For example scanf and printf. C++ uses objects for input output. For example cin and cout. C does not provide direct support for error handling (also called exception handling) C++ provides support for exception handling. Used for errors that make the code incorrect. C does not support reference variables. C++ supports reference variables. #include <iostream> using namespace std; int main() { cout << "Hello World." ; return 0 ; }   #include <iostream>:  This is a header file library. <iostream> stands for standard input-output stream. It allows us to include objects such as cin and cout, cerr etc.   using namespace std:  Means that names for objects and variables can be used from t...