摘要:
1、结构体的声明和结构体变量的定义 #include <stdio.h> #include <string.h> int main() { struct Person { char name[20]; char address[20]; }; struct Person A; struct Pers 阅读全文
1、结构体的声明和结构体变量的定义 #include <stdio.h> #include <string.h> int main() { struct Person { char name[20]; char address[20]; }; struct Person A; struct Pers 阅读全文
posted @ 2022-02-28 15:52
轩~邈
阅读(80)
评论(0)
推荐(0)
1、strcpy 函数 #include <stdio.h> #include <string.h> int main(void) { char boy_Name1[20]; const char* boy_Name2 = "Mingming "; strcpy(boy_Name1, boy_Nam
字符串的声明和定义 字符串是以空字符(\0)结尾的char类型数组,如果没有空字符(\0),那么就是字符数组而不是字符串。 利用数组和指针形式创建字符串 #include <stdio.h> int main() { char words_1[30] = "\"Run! Forrest, run!\
1、 指针是什么? 指针表示变量的地址,例如ptr=& pooh,其中&取地址符取出pooh变量的地址然后赋值给ptr,此时ptr可看成指针变量,指向pooh变量 2、指针变量的声明和赋值 int *pi, char *pc, float *pf 3、取地址运算符 和 解引用运算符 (1)取地址运算
浙公网安备 33010602011771号