I am making a program that shifts values left or right depending on the value of the 2nd argument. If it is positive then it shifts left, else it shifts right. N is the number of times it shifts left or right. I am having trouble in implementation of my Macros.
#include <stdio.h>
#define SHIFT(value, n)
#if (n) > 0
(unsigned int value) <<= (int n);
#else
( (unsigned int value)) >>= (int -n);
int main()
{
printf("%d\n", SHIFT(1, 4));
}
Currently I am getting a conditional directive error.