C | C++ |
---|---|
It is a structural or procedural programming language. | It is an object-oriented programming language. |
Emphasis is on procedure or steps to solve any problem. | Emphasis is on objects rather than procedure. |
Functions are the fundamental building blocks. | Objects are the fundamental building blocks. |
It follows top down approach. | It follows bottom up approach. |
In C, data is not secured. | In C++, data is secured. |
It uses scanf () and printf () function for standard input and output. | It uses cin >> and cout << function for standard input and output. |
Variables must be defined at the beginning in the function. | Variables can be defined anywhere in the function. |
Memory management operators available in C are malloc, calloc etc. | Better dynamic memory management operators available in C++ are new, delete etc. |
In C, namespace feature is absent. | In C++, namespace feature is present. |
C is a middle-level language. | C++ is a high-level language. |
Programs are divided into modules and functions. | Programs are divided into classes and functions. |
C program files are saved with .c extension. | C++ program files are saved with .cpp extension. |
"stdio.h" - header file is used. | "iostream.h" – header file is used. |
main () should not return a value. | main () should return a value. |
Features like function overloading and operator overloading are not present. | It supports function overloading and operator overloading. |
The concept of polymorphism is absent. | The concept of polymorphism is present. |
The concept of inheritance is absent. | The concept of inheritance is present. |
Saturday, 31 December 2016
Friday, 30 December 2016
Abstract Class Vs Interface
Abstract Class | Interface |
---|---|
Abstract classes are classes that contain one or more abstract methods. | An Interface is a blueprint of class. |
It can have abstract and non-abstract methods. | It can have only abstract methods. |
It doesn’t support multiple inheritance. | It supports multiple inheritance. |
It can have final, non-final, static and non-static variables. | It has only static and final variables. |
It can have static methods, main method and constructor. | It can’t have static methods, main method or constructor. |
It doesn’t provide full abstraction. | It provides full abstraction. |
It can provide the implementation of interface. | It can’t provide the implementation of abstract class. |
A class may inherit only one abstract class. | A class may inherit several interfaces. |
The abstract keyword is used to declare abstract class. | The interface keyword is used to declare interface. |
Example: public abstract class Test { public abstract void draw(); } |
Example: public interface Drawable { void draw(); } |
Thursday, 29 December 2016
Static Binding Vs Dynamic Binding
Static Binding | Dynamic Binding |
---|---|
It is also known as early binding or compile time binding. | It is also known as late binding or run-time binding. |
It is done at compile time. | It is done at runtime. |
The compiler can tell the CPU to jump directly to the function’s address. | The program has to read the address held in the pointer and then jump to that address. |
It is more efficient than dynamic binding. | It is less efficient than static binding. |
It is less flexible than dynamic binding. | It is more flexible than static binding. |
Wednesday, 28 December 2016
Gouraud Shading Vs Phong Shading
Gouraud Shading | Phong Shading |
---|---|
This method is also known as interpolation shading or color interpolation shading method. | This method is also known as normal vector interpolation shading. |
This method was introduced by Henri Gouraud in 1971. | This method was introduced by Phong Bui Tuong in 1973. |
It calculates the intensity at each vertex of polygon. | It calculates the average limit normal vector at each vertex of polygon. |
It interpolates intensity over the surface of the polygon. | It interpolates the vertex normal over the surface of the polygon. |
The problem of mach bands is more. | The problem of mach bands is less. |
Example- Consider a figure where colour of point P inside the triangle is found by bilinear interpolation. Here scan line containing P intersects two edges at points P' and P". We first calculate the intensity at three vertices P1, P2, P3. We interpolate the colour of P1 and P2 to get the colour of P' we then interpolate the colour of P2 and P3 to get the colour of P". Finally, we interpolate the colour of P' and P" to get the colour of P. |
Example- Consider a figure where we find the normal vector N at point P in a triangle, we first interpolate N1 and N2 to get N', then interpolate N2 and N3 to N" and finally interpolate N' and N" to get N. |
Tuesday, 27 December 2016
Object Vs Class
Object | Class |
---|---|
Object is an instance of a class. | A class can have many objects. |
Data and function which combine into a single entity is called an object. | A class combine data (called data members) and functions (called member functions). |
Object is a dynamic entity. | Class is a static entity. |
It is a real-time entity. | It is just a specification or logical entity. |
It occupies space in memory. | It does not occupy space in memory. |
It can be manipulated. | It cannot be manipulated because it is not available in the memory. |
Examples of objects are apple, mango etc. | Examples of class are fruit, person etc. |
Monday, 26 December 2016
CRT Vs LCD
CRT | LCD |
---|---|
CRT stands for Cathode Ray Tube. | LCD stands for Liquid Crystal Display. |
It uses electron guns that strike the phosphor dots on screen to produce light. This creates an image. | An image is generated by passing polarized light through liquid crystal material. |
It is bulk and heavy. | It is thin, compact and light weight. |
It consumes more power. | It consumes less power. |
It is cheap. | It is expensive. |
It suffers from the problem of image flickering. | It does not suffer from image flickering. |
It is free from the problem of dead pixel. | It suffers from the problem of dead pixel. |
It has good response time. | It has low response time. |
There is no effect of high and low temperature on CRT. | LCD display cease to function in severe cold. There is loss of contrast in high temperature environment. |
Light guns or pens can be used on CRT. | Light guns or pens cannot be used on LCD. |
It is used in televisions and old computer monitors. | It is used in flat screens such as laptops, cell phones, video games and calculators. |
Sunday, 25 December 2016
Beam Penetration Method and Shadow Mask Method
'
Beam Penetration Method | Shadow Mask Method |
---|---|
Only four colors can be produced- red, green, yellow and orange. | Millions of colors can be produced. |
Less colors are available as the colors produced depends upon the speed of electron beam. | Millions of colors are available as it depends upon the intensity values for the three guns. |
Only one electron gun is used. | Three electron guns are used i.e. red, green and blue. |
Picture quality is poor as different colors and shades are not possible. | Picture quality is good as it is possible to produce several different colors and shades. |
It does not provide realistic display. | It is suitable to display realistic scenes and images. |
It gives high resolution. | It gives low resolution. |
It is less expensive than shadow mask method. | It usage of high quality shadow mask usually increases the cost of shadow mask CRT. |
It is used in random scan system to display color. | It is used with raster scan system including video monitors and TVs. |
Saturday, 24 December 2016
Object Space Model Vs Image Space Model
Object Space Model | Image Space Model |
---|---|
This model defines the object with real world dimensions and volumes. | This model defines the object with dimensions of the image, created to be displayed on the display device. |
The unit of such dimensions may be in kilometers, meters or even in microns. | It makes use of scaled dimensions. |
Object space algorithms are less efficient than image space algorithms. | Image space algorithms are more efficient than object space algorithms. |
Object space algorithms are more functional than image space algorithms. | Image space algorithms are less functional than object space algorithms. |
Color calculation is done only one time and is retained by it. | Color calculation once done is overwritten later. |
Friday, 23 December 2016
Static RAM Vs Dynamic RAM
Static RAM | Dynamic RAM |
---|---|
It consists of flip-flops that store the binary information. | It stores the binary information in the form of electric charges that are applied to the capacitors. |
It has small storage capacity in a single memory chip. | It has large storage capacity in a single memory chip. |
It is faster as compared to dynamic RAM. | It is slower as compared to static RAM. |
These are difficult to construct. | These are easier to construct. |
It need not to be refreshed. | It needs to be refreshed periodically as stored charge on capacitor discharges with time. |
It is more expensive. | It is less expensive. |
It is easier to access. | It is harder to access. |
It is used for cache memory. | It is used for computers main memory. |
Thursday, 22 December 2016
Perspective Projection Vs Parallel Projection
Perspective Projection | Parallel Projection |
---|---|
The Centre of Projection (COP) is at finite distance from the projection plane. | The Centre of Projection (COP) is at infinite distance from the projection plane. |
The projectors converge to a point on a view plane. This point is called vanishing point. | The projectors are parallel. |
It is defined by specifying the centre of projection. | It is defined by specifying the Direction of Projection (DOP). |
It provides the realistic view of an object. | It does not provide realistic view of an object. |
It does not preserve relative proportions of an object i.e. distance and angles are not preserved. | It preserves relative proportions of an object i.e. shape and scale of object remains same. |
Depending upon the number of vanishing points, it is of three types- one point, two point and three point. | Depending upon the direction of projection with respect to projection plane, parallel projection is of two types- orthographic and oblique projection. |
It does not provide exact distance and angle therefore, it is not used as tool of exact measurement. | It provides the accurate views of the various sides of an object and therefore it is used as a tool of exact measurement. |
It is used by the artists to prepare perspective drawings of 3D objects and scenes. | It is used by architects, designers, drafters to create blueprints and scale drawings of 3D objects. |
Wednesday, 21 December 2016
C++ Vs Java
C++ | Java |
---|---|
C++ is an extension of C with object-oriented behavior. | Java is a true and complete object-oriented language. |
It offers template classes. | It does not provide template classes. |
It achieves multiple inheritance by permitting classes to inherit from multiple classes. | It supports multiple inheritance using interfaces. |
Global variables can be declared in C++. | It does not provide global variables. |
It supports pointers. | It does not support pointers. |
In C++, destruction of object is performed by destructor function. | In java, destruction of objects is performed by finalize method. |
It has header files. | It doesn’t provide header file. |
It supports operator overloading. | It does not support operator overloading. |
The test expressions for control flow constructs return an integer value. | The test expressions for control flow constructs return a Boolean value. |
There is scope resolution operator (: :) in C++. | There is no scope resolution operator in java. |
It does not support documentation comments. | It has built in support for documentation comments (/**………*/). |
It is compiled directly to machine code which is then executed directly by the central processing unit. | It is compiled to byte – code which the Java Virtual Machine (JVM) then interprets at runtime. |
It does not support multithreading. | It supports multithreading. |
It supports go to statement. | It does not support go to statement. |
Virtual keyword is present in C++. | There is no virtual keyword. |
String in C++ are array of characters. | Strings in java are objects. |
Strings are terminated by null character. | Strings are not terminated by null character. |
It supports structures or unions. | It does not support structures or unions. |
It only uses compiler. | It uses both compiler and interpreter. |
It doesn’t use packages. | It uses packages. |
It has a preprocessor. | It does not have a preprocessor. |
It is mainly used for developing system software. | It is mainly used for developing applets. |
It supports storage classes like auto, extern etc. | It does not support storage classes. |
It supports default arguments. | It does not support default arguments. |
It supports typedef keyword. | It does not support typedef keyword. |
Inline functions can be made in C++. | There are no inline functions in java. |
It generates object code and the same code may not run on different platforms. | It is interpreted for the most part hence platform independent. |
We may not include the try/catch even if the function throws an exception. | In java, try/catch must be defined if the function declares that it may have thrown an exception. |
It has low portability. | It has high portability. |
It supports multi-dimensional arrays. | It does not support multidimensional arrays. However, it is possible to create arrays of arrays to represent multidimensional arrays. |
Standard output example in C++, cout<<”Hello”; | Standard output example in java, System.out.print(”Hello”); |
Monday, 19 December 2016
Active Attacks Vs Passive Attacks
Active Attacks | Passive Attacks |
---|---|
Active attacks are based on the modification of the original message in some manner or creation of false message. | In passive attacks, the attacker indulges in eavesdropping or monitoring of data transmission. |
The contents of original message are modified. | There is no modification to the contents of an original message. |
The attacker needs to gain the physical control of the media. | The attacker needs to observe the conversation. |
These attacks are relatively easier to detect. | These attacks are harder to detect. |
These attacks cannot be prevented easily. | These attacks can be prevented by encryption of data. |
There are four types of active attacks-
|
There are two types of passive attacks-
|
Friday, 16 December 2016
Symmetric Cryptography Vs Asymmetric Cryptography
Symmetric Cryptography | Asymmetric Cryptography |
---|---|
In symmetric cryptography, same key is used for encryption and decryption. | In asymmetric cryptography, different keys are used for encryption and decryption. |
It is also known as private key cryptography. | It is also known as public key cryptography. |
It is faster than asymmetric cryptography. | It is slower than symmetric cryptography. |
It is less secure. | It is more secure. |
It is less complex. | It is more complex. |
Secret channel is required to send the secret key. | No secret channel is required for the exchange of public key. |
The most commonly used symmetric algorithms include DES, AES and RC4. | The most commonly used asymmetric algorithm is RSA. |
Subscribe to:
Posts (Atom)