I'm trying to make hex-integer converter, since it's an exercise in this book of mine that I'm learning C from... yeah yeah, learning from a book, get the criticisms out of your systems
Anyways, I've got this far...
#include <stdio.h>
#include <ctype.h>
#include <math.h>
main()
{
int i, quit, hex, wait;
printf("Enter hexadecimal number...\n");
scanf("%0X", hex);
printf("%x", hex);
wait = sqrt (3.0);
while (wait != 1){
sqrt(wait);
}
}
About the sqrt bit, that's just an ad hoc way of stalling the program so i can see what it's doing, I'm not really concerned about that...
I've not got anywhere with the hex-int conversion, because I don't really understand the scanf function, and I've never been any good at learning it from cryptic definitions from a book or teacher etc.
It either crashes or gives me a GIGO answer...
Only thing is I don't understand why my input is garbage
So I've reduced the project down to a simple input-output program until I get the hang of the scanf function, only I can't...
Anyone wanna show me the light? lol
IntelMole