Hi!
I am writing a program that will keep track of books through their ISBN numbers. However, I have a function that will test to ensure that the string IS a valid ISBN Number and thats where I am having trouble. My function prototype is:
static bool IsValidISBN(const CString & sISBN)
//sISBN is the name of the string
{
}
there are three criteria the string has to meet before it is assumed valid:
1) The string must be exactly 13 char's long
2) It must have three dashes in the correct spots
3) There cannot be two dashes in a row
This is what a VALID ISBN looks like: 0-672-30787-1
If you could give me some help on developing code for this function I would REALLY appreciate it!
Thank You!!!
I am writing a program that will keep track of books through their ISBN numbers. However, I have a function that will test to ensure that the string IS a valid ISBN Number and thats where I am having trouble. My function prototype is:
static bool IsValidISBN(const CString & sISBN)
//sISBN is the name of the string
{
}
there are three criteria the string has to meet before it is assumed valid:
1) The string must be exactly 13 char's long
2) It must have three dashes in the correct spots
3) There cannot be two dashes in a row
This is what a VALID ISBN looks like: 0-672-30787-1
If you could give me some help on developing code for this function I would REALLY appreciate it!
Thank You!!!