我想知道是否有一种方法或方法来检查数组中的单个字符
char* s[size] = {
"0-2324-2324-7",
"032121353X",
"0-619-66248-X",
"0-758-50938-6",
"0870495275"
};
Run Code Online (Sandbox Code Playgroud)
我想我必须编写遍历数组中每个条目的for循环和遍历数组内该条目中每个字符的for循环
有点像:
for (int i=0;i<size;i++)
for (int j=0; j<"size of s[i]"; j++) // the size of an entry so "032121353X" would be 10
int* c= "the j character in s[i]" // assigns c the individual character in s[i]
if(c<='0'||c>='9') // checks if its a digit
Run Code Online (Sandbox Code Playgroud)