[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function iszip - is a zip code valid for a state
Syntax boolean iszip(char *state, char *zip);
Prototype in statehk.h
Remarks iszip() checks if a zip code is valid for the state
given by its abbreviation. See isstate for valid
state abbreviations.
Currently, iszip() requires the zip code to be a
string, which is internally converted to a long via
atol(). This was done to provide potential future
expansion to support non-numeric zip codes (i.e.
Canada, etc.) in the future.
Return value returns TRUE if the zip code is valid for the state
given. If the state abbreviation is not valid, or
the zip code is not valid for the state, FALSE is
returned.
Note For Canal Zone (CZ), any zip code will return as
valid. I could not determine the range of valid zip
codes for the Canal Zone.
See also statehk.h
isstate(), stateindex()
Example #include <statehk.h>
{
printf("11554 is ");
if (!iszip("NY","11554"))
printf("NOT ");
printf("a valid zip code for NY\n");
}
Program output AL is a valid state abbreviation
See Also:
isstate()
stateindex()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson