i want to write a little pseudo assembler in C. (please don't tell me how stupid of an idea this is) Is there a built-in function in C that allows me to go from ascii chars --> binary. And then go from binary --> hex. Something along the lines of how atoi() works? I couldn't find anything, it would save me some time though.
Is there a Haskell equivalent of list-ref? Without the combinable cars and cudders accessing deeper elements of a list is a pain in the ass, so I need some simpler way of doing it (fst and snd don't combine like cars and cudders, ay?).
Umm... I'm sure there's an advantage... I believe you get nicer error messages when it fails. I suppose you can implement error checking easier too.
Name:
Anonymous2007-12-07 14:54
>>1 Is there a built-in function in C that allows me to go from ascii chars --> binary. And then go from binary --> hex.
Hahaha oh wow
Lern2C
In C (actually, in computers), anything is a number. What you store in a char is a series of bits. You then choose to represent (display) it as a number, a character, an hexadecimal number, etc.
For example:
char c = 65;
printf("As a character: %c", c);
printf("As an integer: %d", c);
printf("Hexadecimal number: %H", c);