body, html { width: 100%; height: 100%; } body{ padding-top:100px; } body, h1, h2, h3, h4, h5, h6 { font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; } #content{ min-height: 600px; } #banner_image { padding-bottom: 50px; text-align: center; color: #f8f8f8; background: url(../img/intro-bg_1.jpg) no-repeat center center; background-size: cover; } #banner_content { position: relative; padding-top: 6%; padding-bottom: 6%; margin-top: 12%; margin-bottom: 12%; background-color: rgba(0, 0, 0, 0.7); max-width: 660px; } #item_list { padding-top: 50px; } /*This code ensures that when we navigate to a particular section of a page, the section does not get lost behind the header*/ #cameras:before, #watches:before, #shirts:before{ display: block; content: " "; margin-top: -85px; height: 85px; visibility: hidden; } #login-panel .panel-footer{ font-weight:normal; } footer { padding: 10px 0; background-color: #101010; color:#9d9d9d; bottom: 0; width: 100%; } .red{ color:red; } #settings-container{ margin-bottom:10px; } .navbar-brand{ font-size:20px; } @media(max-width:768px) { #banner_content { padding-bottom: 15%; } footer{ text-align:left; } } .remove_item_link{ color:#0000ff; }

Difference between C and C++

The major difference between C and C++ is that C is a procedural programming language and does not support classes and objects, while C++ is a combination of both procedural and object oriented programming language; therefore C++ can be called a hybrid language. The following table presents differences between C and C++ in detail.
1 C was developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs.
C++ was developed by Bjarne Stroustrup in 1979 with C++'s predecessor "C with Classes".
2 When compared to C++, C is a subset of C++.
C++ is a superset of C. C++ can run most of C code while C cannot run C++ code.
3 C supports procedural programming paradigm for code development.
C++ supports both procedural and object oriented programming paradigms; therefore C++ is also called a hybrid language.
4 C does not support object oriented programming; therefore it has no support for polymorphism, encapsulation, and inheritance.
Being an object oriented programming language C++ supports polymorphism, encapsulation, and inheritance.
5 In C (because it is a procedural programming language), data and functions are separate and free entities.
In C++ (when it is used as object oriented programming language), data and functions are encapsulated together in form of an object. For creating objects class provides a blueprint of structure of the object.
6 In C, data are free entities and can be manipulated by outside code. This is because C does not support information hiding.
In C++, Encapsulation hides the data to ensure that data structures and operators are used as intended.
7 C, being a procedural programming, it is a function driven language.
While, C++, being an object oriented programming, it is an object driven language.
8 C does not support function and operator overloading.
C++ supports both function and operator overloading.
9 C does not allow functions to be defined inside structures.
In C++, functions can be used inside a structure.
10 C does not have namespace feature.
C++ uses NAMESPACE which avoid name collisions.
A namespace is a declarative region that provides a scope to the identifiers (the names of types, functions, variables, etc) inside it. Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries. All identifiers at namespace scope are visible to one another without qualification. Identifiers outside the namespace can access the members by using the fully qualified name for each identifier.
11 C uses functions for input/output. For example scanf and printf.
C++ uses objects for input output. For example cin and cout.
12 C does not support reference variables.
C++ supports reference variables.
13 C has no support for virtual and friend functions.
C++ supports virtual and friend functions.
14 C provides malloc() and calloc() functions for dynamic memory allocation, and free() for memory de-allocation.
C++ provides new operator for memory allocation and free operator for memory de-allocation.
15 C does not provide direct support for error handling (also called exception handling)
C++ provides support for exception handling. Exceptions are used for "hard" errors that make the code incorrect.
Post a Comment

Amazing Facts about Programming

Amazing Facts about programming  The first programmer was a lady named Ada Lovelac . She was a writer and gifted mathematician...

Popular Tutorials