swap (int *pa, int *pb) { *pa ^= *pb; *pa ^= *pa; *pa ^= *pb; }
The required c program is given below /*Swapping(interchange) the two entered numbers*/ #include<stdio.h> main() { /*Without using third variable*/ int a,b,t; printf("Enter a:"); scanf("%d",&a); printf("Enter b:"); scanf("%d",&b); a=a+b; b=a-b; a=a-b; printf("\n After swapping without using third variable"); printf("\na=%d\nb=%d",a,b); }
Accessing data by address. Some data-structures, like lists and trees, are usually implemented using pointers.
To swap two numbers N1 and N2, using a third variable T... T = N1; N1 = N2; N2 = T;
Stacks are often implemented using the same node structure as a linked list.
program to find maximum of two numbers using pointers
yes
swap (int *pa, int *pb) { *pa ^= *pb; *pa ^= *pa; *pa ^= *pb; }
sorry
Third March, two thousand and eleven.
No.
The required c program is given below /*Swapping(interchange) the two entered numbers*/ #include<stdio.h> main() { /*Without using third variable*/ int a,b,t; printf("Enter a:"); scanf("%d",&a); printf("Enter b:"); scanf("%d",&b); a=a+b; b=a-b; a=a-b; printf("\n After swapping without using third variable"); printf("\na=%d\nb=%d",a,b); }
performing string operation using pointers
Just a guess: KEVIN (3rd June 2011 is Kevin's name day)
Using this you specify that two pointers can't point on the same address
In C programming, header files are required. It doesn't matter if you are using near pointers, far pointers, both, or neither -- you still need header files. There is no connection between the necessity of header files and the pointers' size.
Accessing data by address. Some data-structures, like lists and trees, are usually implemented using pointers.