ankitweblogic logo
W e b t u t o r i a l s

Programing Approach

Algorithm

Flow Chart

Define C

Define Programming

C - Syntax

C - Variables

C - Keywords

C - Data Types

C - Comments

Turbo C - Shortcut keys

C - Operators

Hierarchy of Operators

Ex: Arithmetic Operator

Constant Variable

C - Escape Sequence

Control Structure - if

Ex: If condition

Ex: Inc / Dec Operator

C - loops

Ex: Loops

C - Nesting Of loops

Ex: Nested Loops

Jumping Statements

C - Arrays 1D

C - Arrays 2D

C - Sorting

ASCII Value

Character I/O Function

C - Strings

Ex: Strings

Array of Strings

C - Math Functions

User-defined Function

Exercise Function

C - Types of Functions

Storage Class

C - Header Files

C - Preprocessor

C - Pointers

C - Structures

C - Typedef

C - File Handling

Ex: File Handling

Command Line Argument

MCQ

Pointers

A pointer is a variable whose value is the address of another variable. Like any variable, you must declare a pointer before storing any variable address.
int a=10
int *p;
p=&a;

Pointer to Pointer:
int **p, **q;
int i=90;
(*p)=&i;
(*q)=*p;
printf(“Address of i = %u”, &i);
printf(“\nvalue of i = %d”, i);
printf(“\n**p = %u\n”, **p);
printf(“*p=%u\n”,*p);
printf(“\n**q=%d”,**q);
*q=*(*p);
printf(“\n*q=%u”,*q);
printf(“\n**q=%u”,**q);

Q Input 10 numbers in pointers & find smallest & largest number.

Pointer can be use as an arrays.

#include <stdio.h>
#include <conio.h>
void main()
{
int a[10],i,*p;
clrscr();
printf("enter ");
for(i=0;i<=9;i++)
scanf("%d",&a[i]);
p=a;
printf(" %d",*p);
p=p+2;
printf(" %d",*p);
p--;
printf(" %d",*p);
getch();
}

Output:
Enter 1 2 3 4 5 6 7 8 9 10
1 3 2