20 lines
264 B
C
20 lines
264 B
C
#include "p1.h"
|
|
|
|
#include <ctype.h>
|
|
|
|
int count_alphanumeric(const char* str) {
|
|
int num_alphanumeric = 0;
|
|
const char* current = str;
|
|
|
|
while (*current != '\0') {
|
|
if (isalnum(*current)) {
|
|
++num_alphanumeric;
|
|
}
|
|
|
|
++current;
|
|
}
|
|
|
|
return num_alphanumeric;
|
|
}
|
|
|