1. ## More Questions??

I'm writing a program that will ask the user to input a decimal number, convert it to hex, do some simple math and compare the answer with the original input (converted to hex). 2 questions:

1. Do I have to use a string to use hex?
2. How do I compare 2 hex numbers or 2 strings. I setup the program such that hex numbers would be integers so of course it doesn't work. Any help would be great.

2. 1. No
2a. The same way you compare any integer.
2b. Use strcmp for comparing strings.

hex is just a different way of displaying numbers. You don't have to use hex to do any math on an integer.

Quzah.

3. Thanks, 2a is way easier than what i was trying to do.

4. Keep getting RUNTIME ERROR CHECK FAILURE: stack around variable raid6 is corupt. Here is the peice of code:

Code:
```/* First we must determine if we are using a RAID-6 device*/

printf("Is this a RAID-6 device Y/N: ");
scanf ("%s", &raid6);
getchar();

/*if yes or no is not entered we get stuck in this loop*/

while (raid6 != 'Y' && raid6 != 'N' && raid6 != 'y' && raid6 != 'n')
{
printf ("Invalid input, please enter Y/N: ");
scanf ("%s", &raid6);
getchar();
}```
I always have problems with the scanf buffer yet I continue to use it. Is there a way to clear this in between steps?

5. If raid6 is a character variable, then your scanf is woefully broken, since %s is not for characters. If raid6 is a character array, then &raid6 is not what you want.

6. 1. sscanf might as well read too many characters, use "%c"
2. In every case it will append a NUL at the end of the array. If you enter a letter, the NUL will go past the array, invalidating memory.

7. I got it to work, thanks guys!