Friday, 12 December 2014

Pointer in C

Pointer in C are one of the amazing tools that can be used while programming. The are very useful in dynamic allocation and also they decrease the program execution time that is time required to run the program.

By the definition if we talk than :

A pointer is a variable whose value is the address of the another variable.


Declaring a pointer :



type *var-name ;


Here type is the base type of the pointer (it can be int,float,long,double,etc.) while "var-name" is the name of the variable. When asterisk(*) sign is added before the variable than that variable is known as pointer variable.

NOTE :- In case of multiplication asterisk(*) sign is placed after the variable while in case of pointer they are placed before the variable.



int *a; //pointer to an integer

double *df; //pointer to a double

char *ch; //pointer to a character



EXAMPLE :


#include&ltstdio.h&gt
int main()
{
int *point, c=98;
point = &c;   /* Ampersand(&) assigns the address of variable  to pointer variable.*/
printf("Value of pointer is : %d", *point);
printf("Address to which pointer points : %p",point);
}



VIDEO FROM OUR YOUTUBE CHANNEL :





Thursday, 11 December 2014

Bitwise Operator in C


So in this blog I would be basically discussing about the Bitwise Operators.

Bitwise Operators are special kind of operators in C which work on the bits. We know that C was basically developed to create the unix operating system and it comprises of best elements of both High-Level Language as well as low level language. So an operator was required to work on the low level that is the bits.

Bitwise operator are basically used in device drivers - such as modem programs, disk file routines, and printer routines.

We can not use bitwise operator in float, double, long double, void or other more complex types.


                        TYPES OF BITWISE OPERATORS


OPERATORACTION
&AND
|OR
^XOR
~One's complement(NOT)
&gt&gtShift right
&lt&ltLeft right




PART-I :


PART-II :


Monday, 8 December 2014

Introduction to C

Hello Friends ! 

How are you ?

This is my first blog. In this blog I would be writing about the Programming Language C and its features. 

HISTORY OF C


C was developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. Earlier days there were many programming languages in development. BCPL was one of those older languages. The development of C started with the development of BCPL and BCPL was developed by Martin Luther Richards. BCPL lead to the development of Language called B and this finally lead to the development of C. C provided an easy and faster way of compilation.
  







STANDARDS OF C


Soon C spread rapidly on different operating platforms, eventually it spread beyond unix for which the C was written. Researchers realized that a platform-independent standard for C is required to avoid creating of some incompatible types.

In the summers of 1983 a committe was established to create an ANSI(American National Standards Institute) that would define the language C. This process of standardization of C language took almost 6 years.
ANSI(American National Standards Institute) published a formal standard for the language in December 1989. This standard was soon accepted by almost everyone who used C. The original ANSI standard was officially called ANS X3.159-1989, but everyone called it the ANSI C standard.

A Joint Technical Comittee of ISO (International Standards Organization) and IEC (International Electrotechnical Commission) adopted the ANSI C standard in 1990 with some minor changes, as an International Standard it was formally known asISO/IEC 9899:1990.

C defined by 1989 standard is commonly referred as C89. The development of C++ standard consumed most programmers attention but the work on C moved quietly along with a new standard known as C99. 1999 standard for C is known as C99. We would be learning about C99 and C89 in further classes.