Can anybody provide me a code for
Macro to exchange the nibbles??
regards
Prakash
Printable View
Can anybody provide me a code for
Macro to exchange the nibbles??
regards
Prakash
hi..frnd
here i have written one program to exchange the byte for 2 byte variable..
from this you can derive for the nibble:
#include<conio.h>
#include<stdio.h>
void swapNibble(int);
void main()
{
short int x;
printf("sizeof int = %d",sizeof(x));
printf("Enter the value:");
scanf("%d",&x);
swapNibble(x);
getch();
}
void swapNibble(int var)
{
var = var << 8;
printf("\nvalue after shifting the var is = %d",var);
}