So this is the code I have so far which puts a bitmask seperator base on what I choose. My problem is when Im trying to do them in this manner.
1. 0 to 31, with minimum width set to 8, and separating between every 4 digits.
2. 2^0 to 2^16, with minimum width set to 17, separating between every 8 digits.
3. (2^0-1) to (2^16-1) with minimum width set to 16, and no seperation between digits.
I try doing number 2 called "String multyplyByTwo" but seems to be getting errors.
If anyone can point me to the right direction would greatly appreciate it.
The binToChar function looks like it should be working.. except I have no idea what the sepMask parameter is supposed to do. It looks like it just inserts underscores throughout the string?
Can you give a more clear example of what you're doing? Please advise the below:
1) An example function call: (ie: binToChar(0x11, 8, 0xF3))
2) Your desired output (what you'd want the function to return with that call)
3) The actual output (what your function is actually returning).
With those 3 things it'll be much easier to understand and spot the problem.
First of all thank you for replying. The binToChar does work its the multyByTwo function that I cant seem to get right. I'm doing three different calls for the three questions so 3 seperate function calls and the sepMask does put an underscore based on the desire number, for example if i choose questions one the output should be " 0000_0000" for #2 "0_00000000_00000001 and for #3
"00000000000000000"
is a function declaration. And the likely error code (which you should've supplied) probably mentions a missing semi-colon. It sort of looks like you're trying to define the function inside of main, and you cannot do that.