指针函数
来源:互联网 发布:二手货车估价软件 编辑:程序博客网 时间:2024/05/20 05:25
#include <stdio.h>
int main()
{
int func(int *p1, int *p2, int *p3);
int a, b, c;
int *pointer_1 = &a;
int *pointer_2 = &b;
int *pointer_3 = &c;
printf ("enter a b c:");
scanf ("%d %d %d", &a, &b, &c);
func(pointer_1, pointer_2, pointer_3);
printf("%d %d %d",*pointer_1, *pointer_2, *pointer_3);
return 0;
}
int func(int *p1, int *p2, int *p3)
{
int func1 (int *z1, int *z2);
if (*p1 < *p2)
{
func1(p1, p2);
}
if (*p1 < *p3)
{
func1(p1, p3);
}
if (*p2 < *p3)
{
func1(p2, p3);
}
return 0;
}
int func1(int *z1, int *z2)
{
int temp;
temp = *z1;
*z1 = *z2;
*z2 = temp;
return 0;
}
int main()
{
int func(int *p1, int *p2, int *p3);
int a, b, c;
int *pointer_1 = &a;
int *pointer_2 = &b;
int *pointer_3 = &c;
printf ("enter a b c:");
scanf ("%d %d %d", &a, &b, &c);
func(pointer_1, pointer_2, pointer_3);
printf("%d %d %d",*pointer_1, *pointer_2, *pointer_3);
return 0;
}
int func(int *p1, int *p2, int *p3)
{
int func1 (int *z1, int *z2);
if (*p1 < *p2)
{
func1(p1, p2);
}
if (*p1 < *p3)
{
func1(p1, p3);
}
if (*p2 < *p3)
{
func1(p2, p3);
}
return 0;
}
int func1(int *z1, int *z2)
{
int temp;
temp = *z1;
*z1 = *z2;
*z2 = temp;
return 0;
}
0 0
- 指针函数 函数指针
- 函数指针/指针函数
- 指针函数&函数指针
- 函数指针 指针函数
- 函数指针 指针函数
- 指针函数,函数指针
- 函数指针,指针函数,
- 指针函数,函数指针
- 函数指针 指针函数
- 函数指针、指针函数
- 指针函数&函数指针
- 函数指针 指针函数
- 函数指针 指针函数
- 函数指针&指针函数
- 指针函数 函数指针
- 指针函数 &函数指针
- 函数指针&指针函数
- void指针 函数指针
- mongodb
- 查询日志文件信息+创建日志文件组+创建日志文件
- (HDU 1664)Different Digits BFS + 数论 + 余数判重 详细题解
- Qt入门(2)——注意事项
- 自定义一个AXI-IP核
- 指针函数
- 思科R&D面试
- android 下的selector怎么建
- python简单实现神经网络
- 【技术美术】贴图、纹理、材质的区别
- LaTex做PPT、图片放置、公式输入等经验贴
- Docker gitlab error:Error starting proxy:Bind for 0.0.0.0:22:unexpected error(Failure EADDRINUSE)
- LeetCode 64 Minimum Path Sum(动态规划)
- BaseDao