摘要:
指针变量 指针是一种特殊的变量,它存储的是某个变量的内存地址。指针变量可以存储内存地址,并且通过指针变量可以间接操作内存中的数据 include <stdio.h> int main() { int a=1, * p; //定义指针变量,*是指针运算符 p = &a; //把a的地址赋给指针变量p, 阅读全文
摘要:
while语句 定义 While语句是C语言中的循环语句,它按条件循环执行语句,直到条件不满足为止 语法格式如下: while(condition) { //循环体内容; } 使用实例 求1+2+3+…+100 include <stdio.h> int main(){ int i = 1, sum 阅读全文
摘要:
if语句 if(){} if (a=1){printf("hehe");} //单独一个if if(){}else{} int a = 1, b = 2; if (a == b) { printf("haha"); //if else } else { printf("hehe"); } if(){ 阅读全文