![](https://img-blog.csdnimg.cn/20190918140053667.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
----------C语言----------
C语言
科学之星
代码成就辉煌!
展开
-
C 基于指针交换数据
C 基于指针交换数据 #include <stdio.h> int add(int,int); void swap(int *,int *); int main() { int a,b; printf("Hello, World!\n"); printf("%s%d\n","add result:", add(3,7)); printf("%s","Please enter two numbers:\n"); //交换数据 scanf("%d %d原创 2021-05-14 11:26:29 · 123 阅读 · 0 评论 -
C语言自定义头文件
1.首先我们写一个简单的C源程序; #include<stdio.h> #include<math.h> void main() { int a,b; b=9; printf("The result is %d!",sqrt(b)); } 2.编译C文件 gcc -o main main.c 编译会出现错误,找不到sqrt该...原创 2018-02-27 11:27:27 · 2792 阅读 · 0 评论 -
C语言自己编写头文件
1.首先编写head.h 1 #ifdef _HEAD_H 2 #define _HEAD_H 3 int add(int,int,int); 4 #endif 2.在同级目录下编写head.c 1 #include "head.h" 2 #include <stdio.h> 3 int add(int a,int b,int c) 4 { 5 in...原创 2018-04-25 15:47:01 · 12000 阅读 · 26 评论