鸟语天空
查找地址: &运算符
post by:追风剑情 2019-9-26 20:56

示例:

//Visual Studio中加上这句才可以使用scanf()
//否则只能使用scanf_s()
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdbool.h>

void mikado(int);

//argc: 参数个数 argv[]: 参数数组
int main(int argc, char *argv[])
{
	int pooh = 2, bah = 5;
	printf("In main(), pooh = %d and &pooh = %p\n", pooh, &pooh);
	printf("In main(), bah = %d and &bah = %p\n", bah, &bah);
	mikado(pooh);

	system("pause");
	return 0;
}

void mikado(int bah)
{
	int pooh = 10;
	printf("In mikado(), pooh = %d and &pooh = %p\n", pooh, &pooh);
	printf("In mikado(), bah = %d and &bah = %p\n", bah, &bah);
}

运行测试

11111.png

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容