Quantcast
Channel: MPLAB XC16
Viewing all articles
Browse latest Browse all 1508

Best way to swap a bit (Dukenukem)

$
0
0
Hi everyone,I am trying to make a C function that swaps one random bit (set to 1 if it is 0 and vice versa) of a int variable named "chr". This is the code i wrote so far

srand(buf); //casual seed

pr1=rand() % 16;


Viewing all articles
Browse latest Browse all 1508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>