随笔分类 -  c/c++

上一页 1 2 3 4 5 6 ··· 30 下一页
摘要:c语言中函数形参 -- 值传递,址传递,引用传递 阅读全文
posted @ 2024-11-08 09:39 小鲨鱼2018 阅读(4) 评论(0) 推荐(0) 编辑
摘要:001、函数体内的变量名不可以和形参同名 a、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c #include <stdio.h> int max(int a, int b) { int k = 100; return a > b ? 阅读全文
posted @ 2024-11-07 15:38 小鲨鱼2018 阅读(19) 评论(0) 推荐(0) 编辑
摘要:001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c #include <stdio.h> int max(int a, int b) // 创建一个名为max的函数 { int k = 100; if(a > b) { return 阅读全文
posted @ 2024-11-07 13:04 小鲨鱼2018 阅读(21) 评论(0) 推荐(0) 编辑
摘要:001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ##测试c程序 #include <stdio.h> int main(void) { int i,j; i = j = 5; // 连续赋值 printf("i = %d\n", 阅读全文
posted @ 2024-11-06 19:28 小鲨鱼2018 阅读(72) 评论(0) 推荐(0) 编辑
摘要:001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ## 测试程序 #include <stdio.h> int main(void) { int var1 = 5; // 初始化一个变量var1 int array1[var1] 阅读全文
posted @ 2024-11-06 19:11 小鲨鱼2018 阅读(34) 评论(0) 推荐(0) 编辑
摘要:001、一维数组 [root@PC1 test1]# ls test.c [root@PC1 test1]# cat test.c #include <stdio.h> int main(void) { int v1[5] = {3, 4, 8}; printf("length of v1 is % 阅读全文
posted @ 2024-11-06 09:23 小鲨鱼2018 阅读(20) 评论(0) 推荐(0) 编辑
摘要:001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c #include <stdio.h> int main(void) { double tensu[2][4][3] = {{{3,4,2},{2,4,4},{2,4,3},{1,5 阅读全文
posted @ 2024-11-05 08:51 小鲨鱼2018 阅读(52) 评论(0) 推荐(0) 编辑
摘要:001、 002、 003、 。 阅读全文
posted @ 2024-11-04 23:57 小鲨鱼2018 阅读(5) 评论(0) 推荐(0) 编辑
摘要:001、double型数据的输入 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ## 测试程序 #include <stdio.h> int main(void) { double vx; printf("vx = "); scanf( 阅读全文
posted @ 2024-11-04 11:17 小鲨鱼2018 阅读(40) 评论(0) 推荐(0) 编辑
摘要:001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ## 测试c程序 #include <stdio.h> int main(void) { int i,j,k; int v1[4][3]; int v2[3][4]; int v3 阅读全文
posted @ 2024-10-28 00:06 小鲨鱼2018 阅读(37) 评论(0) 推荐(0) 编辑
摘要:001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ## 测试c程序 #include <stdio.h> int main(void) { int i,j; int v[4][3]; for(i = 0; i < 4; i++) 阅读全文
posted @ 2024-10-27 22:31 小鲨鱼2018 阅读(15) 评论(0) 推荐(0) 编辑
摘要:声明是不赋值; 初始化是给数组元素赋值。 001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ## 测试c程序 #include <stdio.h> int main(void) { int ay[3]; // 声明,不赋值 int 阅读全文
posted @ 2024-10-27 01:43 小鲨鱼2018 阅读(33) 评论(0) 推荐(0) 编辑
摘要:01、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ## 测试c程序 #include <stdio.h> int main(void) { int ay[4][3] = {{2,3,8},{1,4,2},{8,7,3},{6,2,3 阅读全文
posted @ 2024-10-27 00:47 小鲨鱼2018 阅读(35) 评论(0) 推荐(0) 编辑
摘要:001、数组的声明 01、数组的声明包括数组元素的类型,数组元素的类型只能是一种。 02、数组的名称;比如 array1 03、数组的大小(长度) [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c ## 测试c程序 #include <st 阅读全文
posted @ 2024-10-27 00:46 小鲨鱼2018 阅读(151) 评论(0) 推荐(0) 编辑
摘要:001、不使用对象式宏 [root@localhost test]# ls test.c [root@localhost test]# cat test.c ## 测试程序 #include <stdio.h> int main(void) { int i, sum = 0; int v[5] = 阅读全文
posted @ 2024-10-04 11:59 小鲨鱼2018 阅读(32) 评论(0) 推荐(0) 编辑
摘要:001、 [root@PC1 test]# ls test.c [root@PC1 test]# cat test.c #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = " 阅读全文
posted @ 2024-09-20 13:07 小鲨鱼2018 阅读(21) 评论(0) 推荐(0) 编辑
摘要:001、 [root@localhost test]# ls ## 两个测试c程序 test01.c test02.c [root@localhost test]# cat test01.c ## 后置递增运算符,表达式的值等于递增前的表达式的值 #include <stdio.h> int mai 阅读全文
posted @ 2024-09-20 08:47 小鲨鱼2018 阅读(19) 评论(0) 推荐(0) 编辑
摘要:001、 [root@localhost test]# ls test.c [root@localhost test]# cat test.c #include <stdio.h> int main(void) { int i; printf("i = "); scanf("%d", &i); if 阅读全文
posted @ 2024-09-19 08:36 小鲨鱼2018 阅读(31) 评论(0) 推荐(0) 编辑
摘要:001、 [root@localhost test]# ls test.c [root@localhost test]# cat test.c #include <stdio.h> int main(void) { int n1,n2; puts("please input two integers 阅读全文
posted @ 2024-09-04 09:27 小鲨鱼2018 阅读(12) 评论(0) 推荐(0) 编辑
摘要:001、相等运算符 == != 002、关系运算符 > >= < <= 003、条件运算符 a ? b:c [root@localhost test]# ls test.c [root@localhost test]# cat test.c #include <stdio.h> int main(v 阅读全文
posted @ 2024-09-04 09:12 小鲨鱼2018 阅读(10) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 30 下一页
点击右上角即可分享
微信分享提示