Microsoft Visual Studio 2010 預設是沒有 ASP.NET MVC 4,但可自行安裝。
可至微軟官網下載:http://www.microsoft.com/zh-tw/download/details.aspx?id=30683
Microsoft Visual Studio 2010 預設是沒有 ASP.NET MVC 4,但可自行安裝。
可至微軟官網下載:http://www.microsoft.com/zh-tw/download/details.aspx?id=30683
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
code snippets(一):tolower(參數),將大寫英文字母轉成小寫英文字母。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //tolower(參數) //參數:大寫英文字母轉成小寫英文字母。 char str[3]; memset(str,0x00,sizeof(str)); str[0]=tolower('G'); str[1]=tolower('E'); printf("轉換後字元=%s\n",str); } return 0; } //Answer:轉換後字元=ge
code snippets(一):isxdigit(參數),判斷是否為十六進位字元。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //isxdigit(參數) //參數:是否為十六進位字元,條件成立,回傳非 0 值,否則回傳 0。 //十六進位:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F if(isxdigit('g')) { printf("參數是十六進位字元\n"); } else { printf("參數非十六進位字元\n"); } return 0; } //Answer:參數非十六進位字元
code snippets(一):isupper(參數),判斷是否為大寫英文字母。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //isupper(參數) //參數:是否為大寫英文字母,條件成立,回傳非 0 值,否則回傳 0。 if(isupper('A')) { printf("參數是大寫字元\n"); } else { printf("參數是非大寫字元\n"); } return 0; } //Answer:參數是大寫字元
code snippets(一):isspace(參數),判斷是否為空白字元。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //isspace(參數) //參數:是否為空白字元,條件成立,回傳非 0 值,否則回傳 0。 if(isspace(' ')) { printf("參數是空白字元\n"); } else { printf("參數是非空白字元\n"); } return 0; } //Answer:參數是空白字元
code snippets(一):ispunct(參數),判斷是否為顯示字元,不包含空白、字母、數字字元。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //ispunct(參數) //參數:是否為顯示字元,不包含空白、字母、數字字元,條件成立,回傳非 0 值,否則回傳 0。 // if parameter is any below values. //! " # % & ' ( ) ; < = >> ? //[ \ ] * + , - . / : ^ _ { | } ~ if(ispunct('%')) { printf("參數非包含空白、字母、數字字元\n"); } else { printf("參數是包含空白、字母、數字字元\n"); } return 0; } //Answer:參數非包含空白、字母、數字字元
code snippets(一):isprint(參數),判斷是否為含括空格以內可印字元。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //isprint(參數) //參數:是否為含括空格以內可印字元。 //例如:顯示字元,0x20 (' ')到0x7E ('~'),條件成立,回傳非 0 值,否則回傳 0。 if(isprint('~')) { printf("參數是顯示字元 0x20(' ')到0x7E('~')\n"); } else { printf("參數非顯示字元 0x20(' ')到0x7E('~')\n"); } return 0; } //Answer:參數是顯示字元 0x20(' ')到0x7E('~')
code snippets(一):islower(參數),判斷是否為小寫英文字母。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //islower(參數) //參數:是否為小寫英文字母,條件成立,回傳非 0 值,否則回傳 0。 if(islower('A')) { printf("參數是小寫字元\n"); } else { printf("參數非小寫字元\n"); } return 0; } //Answer:參數非小寫字元
code snippets(一):isgraph(參數),判斷是否是顯示字元,不包含空白字元。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //isgraph(參數) //參數:是否是顯示字元,不包含空白字元,條件成立,回傳非 0 值,否則回傳 0。 if(isgraph(' ')) { printf("參數是顯示字元\n"); } else { printf("參數非顯示字元\n"); } return 0; } //Answer:參數非顯示字元
code snippets(一):isdigit(參數),判斷是否為數字。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //isdigit(參數) //參數:是否為數字,條件成立,回傳非 0 值,否則回傳 0。 if(isdigit('5')) { printf("參數是數字\n"); } else { printf("參數非數字\n"); } return 0; } //Answer:參數是數字
code snippets(一):int iscntrl(參數),判斷是否為 ASCII 控制字元。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //iscntrl(參數) //參數:是否為 ASCII 控制字元,條件成立,回傳非 0 值,否則回傳 0。 if(isalpha('A')) { printf("參數是 ASCII 控制字元\n"); } else { printf("參數非 ASCII 控制字元\n"); } return 0; } //Answer:參數是 ASCII 控制字元
code snippets(一):isalpha(參數),判斷是否為字母。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //int tf=isalpha('5'); //isalpha(參數) //參數:是否為字母,條件成立,回傳非 0 值,否則回傳 0。 if(isalpha('5')) { printf("參數是字母\n"); } else { printf("參數非字母\n"); } return 0; } //Answer:參數非字母
code snippets(一):isalnum(參數),判斷是否為字母或數字。
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { //isalnum(參數) //參數:是否為字母或數字,條件成立,回傳非 0 值,否則回傳 0。 int tf=isalnum('5'); //if(isalnum('5')) if(tf != 0) { printf("字元或數字\n"); } else { printf("非字元或數字\n"); } return 0; } //Answer:字元或數字