ABOUT THE C LANGUAGE
In 1970 Dennis Ritchie developed a programing language at bell laboratories .I t was the first used system implementation language for the nascent unix operating system.The main reason to devised c was to overcome the limitation of B.It was derived from the type less language BCPL(Basic combined programming language ).C was the evolution of B and BCPL.It was originally intended for use in writing complex for other language.
Characteristics of C
1.small size
2.structured language
3.it can handle low level activitiese.
4.it produce efficient program
5 .it can be compiled a variety of computer.
eg:
simple program to print "hello"
#include
#include
main()
{
printf("hello");
}
The output will be displayed as hello
Here the main() indicates precisely where the program is to begin.
Draw backs
1.poor error detection which can make it off putting to the beginner.
About the C++ language
Bjarn stroustrup in 1983 at bell laboratories developed a programing language and later it was known as c++ language.It was the extension of c adding some enhacements to the c language.the new fewatures added to the are templates ,namespace ,exception handlingand use of standard library.
C++ is an extension of C
C++ is object oriented
Object oriented programming is focussed on writing programs that are more readable and maintanable.it also helps the reuse of code by packaging a groups of similar objects and the concept of objects,inheritance,polymorphism,encapsulation.An instance of a class is called object.
encapsulation: hiding information from ,members of a class to be declared as either public ,private,or protected.public members of the class is accessable to any function.A private member is accessible only to functions that are members of that class and functions and classes.
poly morphism: existance of one interface in many methods.for example we can use the "+"sign for addin g two numbers as well as concatinating two strings.
inheritance: classes form a hierarchical relationship.
eg:
class a
{
......................
...................
};
class b
{
};
class c:publica,public b
{
};
Draw backs of c++
polymorphism slow down the performance of the problem.
No comments:
Post a Comment