I defined a function, but when I call it I get an error message that says:
*undefined reference to `only_digits'
clang: error: linker command failed with exit code 1 (use -v to see invocation)*
The code is:
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
bool only_digits(string s);
int main(int argc, string argv[])
{
if(argc > 2)
{
printf("Usage: ./caesar key\n");
}
bool only_digits(string s);
for(int i = 0, n = strlen(argv[1]); i<n; i++)
if((argv[1])[i]<='z' && (argv[1])[i]>'A')
{
return false;
}
else
{
return true;
}
bool z = only_digits(argv[1]);
}