J
John Buckley
Hello!
In my program I need to compare a long variable with a size_t variable. The
long variable's value is guaranteed to be positive since it's initialised by
a function returning a positive value (or -1L when an error occurs, which I
check for). When I compare these variables with >, I get the warning
"comparison between signed and unsigned". Given that the long variable is
guaranteed to hold a positive value, can I ignore this diagnostic or should
I deal with it in some way?
BTW, I'm having endless trouble getting the hang of C. I can't quite
understand it because I tend to grasp languages pretty quickly. How long
does it take for C to truly 'click'?
In my program I need to compare a long variable with a size_t variable. The
long variable's value is guaranteed to be positive since it's initialised by
a function returning a positive value (or -1L when an error occurs, which I
check for). When I compare these variables with >, I get the warning
"comparison between signed and unsigned". Given that the long variable is
guaranteed to hold a positive value, can I ignore this diagnostic or should
I deal with it in some way?
BTW, I'm having endless trouble getting the hang of C. I can't quite
understand it because I tend to grasp languages pretty quickly. How long
does it take for C to truly 'click'?