![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c语言学习笔记
文章平均质量分 83
acrifhy
这个作者很懒,什么都没留下…
展开
-
c语言-指针笔记01
c语言-指针笔记01 指针是C和C ++编程的强大功能。 在学习指针之前,让我们先来了解一下一下C中的地址。 C中的地址 如果程序中有变量var,则&var将在内存中提供其地址。 在使用scanf()函数时,我们已多次使用地址。 scanf("%d", &var); 这里用户输入的值存储在var变量的地址中。 让我们举一个可行的例子。 #include <stdio.h> int main() { int var = 5; printf("var: %d\n", var);原创 2021-05-26 06:12:34 · 136 阅读 · 1 评论 -
c语言-结构体实例笔记
结构体实例 实例一览: 使用结构体存储学生的信息 Store information of a student using structure 计算二者距离(以英寸英尺为单位) Add two distances (in inch-feet) 通过结构体传递给函数来计算两个复数相加 Add two complex numbers by passing structures to a function 计算两个时间段之间的差 Calculate the difference between原创 2021-05-21 13:06:38 · 1855 阅读 · 4 评论 -
C语言-结构体笔记2
C语言-结构体笔记2 与内置类型的变量类似,您也可以将结构变量传递给函数。 将结构传递给函数的方法: #include <stdio.h> struct student { char name[50]; int age; }; // function prototype void display(struct student s); int main() { struct student s1; printf("Enter name: "); // rea原创 2021-05-20 20:42:47 · 142 阅读 · 0 评论 -
C语言-结构体笔记1
C语言-结构体笔记1 在C中,结构体是单个名称下的变量(可以是不同类型)的集合。 如何定义结构? 在创建结构变量之前,需要定义其数据类型。 要定义结构,请使用struct关键字。 结构体语法: struct structureName { dataType member1; dataType member2; ... }; 示例: struct Person { char name[50]; int citNo; float salary; }; 创原创 2021-05-20 20:38:26 · 135 阅读 · 0 评论