I’m having trouble putting a 1 bit at a given position.
For example if int e is one, I have put the first bit in neset_t* ne to 1.
I’ve done this so far but does not work.
typedef unsigned short int neset_t;
void add(neset_t* ne,int e){
int num = (int) *ne;
num = num | e;
*ne = (neset_t) num;
}
thanks in advance.
sorry for my english.
Is e is bit position?
In this case you should use
instead