Checking parts of a structure

This is a discussion on Checking parts of a structure within the C Programming forums, part of the General Programming Boards category; I am wondering is it possable to check what the values of a structure are with if statements? I have ...

Checking parts of a structure

I am wondering is it possable to check what the values of a structure are with if statements? I have a strcuture that has three different values in it, and I would like to check each one individually if possable. When I try to do it with what I thought the if statement should be, I am getting an incompatability issue with type. I want to do some simple value checking to ensure that the values in the structure meet my requirement. But perhaps I am thinking about doing this the wrong way. Can someone shed some light on this?

Which works, but I am trying to clear up some data entry problems so that no matter what the user enters it will give the suer the correct information. My first step is to fix the problem with the fact that if they enter 12:01:01 as a strt time and end time of 01:01:01 the get a -11 total time instead of 1.

But I get a syntax error : identifier 'tTime'. I am still trying to get a grip on structures, but am confused as to exactly how they work I guess. I figure once I get this down, I can do some similar stuff to ensure minute and seconds are not >60 and that everything is numeric and not an alpha character. Any help is appreciated.

Tip:
Compile often - like every few lines.
If you get some errors, the problem is almost certainly in the few lines you just added, and therefore much easier to figure out where to start looking for a problem.

Something new added

OK I have my first bit of error checking working, I can ensure users are no entering numbers that are to high for a clock. But I am trying to also ensure they do not enter data that is a letter. I am trying to use isalpha, assuming that if they do enter a letter isalpha will be a true. My code is compiling without error, but when I try to run it no matter what I do I get exited out. So I am thinking something in my arguments logic is off in this case. Because it seems that my isalpha statement is catching everything, not just the letters as I hoped.

OK, add the if

Thanks moi, I have added an if, and corrected the problem with if defaulting to that isalpha option. I also thought I set the is option to run if it is true by adding !=0 after each variable in the structure, but now it does not catch this option at all.