C/C++の宿題を片付けます 80代目
■ このスレッドは過去ログ倉庫に格納されています
0127デフォルトの名無しさん
2007/01/02(火) 03:04:25#include <ctype.h>
#include <stdio.h>
void upper(char *p_data);
void lower(char *p_data);
int main(void) {
char str[] = "channel";
upper(str);
printf("%s\n", str);
lower(str);
printf("%s\n", str);
return 0;
}
void upper(char *p_data) {
while (*p_data != '\0') {
*p_data = toupper(*p_data);
p_data++;
}
}
void lower(char *p_data) {
while (*p_data != '\0') {
*p_data = tolower(*p_data);
p_data++;
}
}
■ このスレッドは過去ログ倉庫に格納されています