摘要: #include<stdio.h> int main() { char* p[] = { "abc", "bcd", "def" }; //char** p = { "abc", "bcd", "def" }error; char* temp; char** p = &temp; //str首元素为 阅读全文
posted @ 2022-03-21 22:03 W-forever 阅读(31) 评论(0) 推荐(0)
摘要: 普通局部变量 1.在{}内部定义的变量就是局部变量 2.只有执行到定义变量这个语句,系统才会给这个变量分配空间 3.当离开{},这个非static自动释放 4.局部变量的作用域是当前的大括号,离开此大括号就无法使用此变量 5.{}的普通局部变量,加不加auto关键字等价,普通局部变量也叫自动变量 6 阅读全文
posted @ 2022-03-21 22:01 W-forever 阅读(171) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<string.h> int main() { char* p = " 123456 "; char* start = p; char* end = p + strlen(p) - 1; //从左往右 while (*start == ' ' && 阅读全文
posted @ 2022-03-21 22:00 W-forever 阅读(30) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<string.h> int main() { char ch[] = "happybodyabcddfbhfdabcd"; char* p = ch; int i = 0; char* temp = NULL; while (1) { //查找匹 阅读全文
posted @ 2022-03-21 21:59 W-forever 阅读(105) 评论(0) 推荐(0)
摘要: //argv[]:它是数组,数组的每个元素都是char *,每个元素都是字符地址 //argc:argv[]元素个数 //main()函数参数,需要用户传递 #include<stdio.h> int main(int argc, char * argv[]) { int i = 0; for (i 阅读全文
posted @ 2022-03-21 21:30 W-forever 阅读(64) 评论(0) 推荐(0)