It is homework that I am working on and that's why I've come here to ask for help with it.
So something like
Code:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int validate(char ISBN[]);
int main(int argc, char** argv)
{
printf("%d\n", validate(argv[1]));
return 0;
}
int validate(char ISBN[])
{
int sum = 0, i = 0;
int numElements = strlen(ISBN);
for(i=0; i < len; i++)
{
if(isdigit(ISBN[i]) !=0)
{
/*...*/
}
else if(ISBN[i] == 'X'
{
'X' = 10
}
if (numElements % 10)
return 0;
else
return 1;
}
Is that right?