惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
Arctic Wolf
T
The Blog of Author Tim Ferriss
月光博客
月光博客
Recent Announcements
Recent Announcements
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 三生石上(FineUI控件)
P
Proofpoint News Feed
The Register - Security
The Register - Security
博客园 - 叶小钗
博客园 - Franky
The Cloudflare Blog
雷峰网
雷峰网
罗磊的独立博客
M
MIT News - Artificial intelligence
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
爱范儿
爱范儿
博客园 - 司徒正美
Recorded Future
Recorded Future
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
F
Full Disclosure
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
B
Blog
大猫的无限游戏
大猫的无限游戏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
WordPress大学
WordPress大学
小众软件
小众软件
K
Kaspersky official blog
Attack and Defense Labs
Attack and Defense Labs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Forbes - Security
Forbes - Security
aimingoo的专栏
aimingoo的专栏
IT之家
IT之家
The Last Watchdog
The Last Watchdog
N
News and Events Feed by Topic
B
Blog RSS Feed
S
Security @ Cisco Blogs
美团技术团队
量子位
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cloudbric
Cloudbric
Hacker News - Newest:
Hacker News - Newest: "LLM"

博客园 - 刘伟_luvi

C项目错误情况小记 s3c2440设置从nfs或从board启动 Hash Functions for Hash Table Lookup 自写linux下的简单man帮助文件 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token Linux MAN命令 在本地计算机无法启动MySQL服务。错误1067:进程意外终止 嵌入式中地址-函数之间的转换 对C语言中结构体的测试分析 悄悄地,你走了 AMBA片上总线 Linux系统环境下的Socket编程详细解析 C语言宏定义技巧(常用宏定义)【转】 s3c2410 MMU详述 可重入函数与不可重入函数(转) 程序的书写规则(程序的编码规范) ARM中C和汇编混合编程及示例 嵌入式系统 Boot Loader 技术内幕(转) 关于Linux系统下网卡手写配置文件的介绍
C数组测试 - 刘伟_luvi - 博客园
刘伟_luvi · 2008-09-03 · via 博客园 - 刘伟_luvi

今天在VC6中测试一下数组的传址方式,发现在main函数中,数组名所指向的地址是与数组中每0个元素的地址相同,但当把数组传给被调函数时,被调函数的形参是以指针的形式接收实参的地址。

在下边的程序中,当你第一次运行的时候,看系统分配给array数组的地址是什么,然后更改程序;

2:把 printf("4:\t1245044==%s\n", 1245044);语句中的后边一个“1245044”更改为你的系统给你的array分配的地址,然后再运行一下看看。

1:把//#define DEBUG改为#define DEBUG

#include <stdio.h>
#include <string.h>
//#define DEBUG

int ArrayAddress(char caArray[])
{
 printf("2:\t&caArray==%d\tcaArray==%d\n", &caArray, caArray);
 return 0;
}

int main(void)
{
 char array[10]="Hello";

 printf("1:\t&array==%d\tarray==%d\n", &array, array);
 ArrayAddress(array);
 printf("3:\t&array==%d\tarray==%d\n", &array, array);
#ifdef DEBUG
 printf("4:\t1245044==%s\n", 1245044);
#endif
 return 0;
}