Code snippets(一):tolower(參數),將小寫英文字母轉成大寫英文字母。
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(int argc, char *argv[])
{
//toupper(參數)
//參數:小寫英文字母轉成大寫英文字母。
char str[3];
memset(str,0x00,sizeof(str));
str[0]=toupper('g');
str[1]=toupper('e');
printf("轉換後字元=%s\n",str);
return 0;
}
//Answer:轉換後字元=GE
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(int argc, char *argv[])
{
//toupper(參數)
//參數:小寫英文字母轉成大寫英文字母。
char str[3];
memset(str,0x00,sizeof(str));
str[0]=toupper('g');
str[1]=toupper('e');
printf("轉換後字元=%s\n",str);
return 0;
}
//Answer:轉換後字元=GE
