搜索
编程论坛
→
开发语言
→
『 C语言论坛 』
→ *(char *)(pInt+1) 如何理解
标题:
*(char *)(pInt+1) 如何理解
只看楼主
hddgwxn586
等 级:
新手上路
帖 子:37
专家分:0
注 册:2017-5-18
结帖率:
66.67%
楼主
问题点数:0 回复次数:1
*(char *)(pInt+1) 如何理解
int main(void)
{
char* str = "ABCDEFGHIJKL";
int* pInt = (int*)str;
printf("%c\n%c\n",*(str+1),*(char *)(pInt+1));
return 0;
}
请教
int* pInt = (int*)str;是什么意思?
*(char *)(pInt+1)是什么意思?
看不懂。
搜索更多相关主题的帖子:
return
如何
2017-05-23 16:00
九转星河
来 自:长长久久
等 级:
贵宾
威 望:
52
帖 子:5023
专家分:14003
注 册:2016-10-22
第
2
楼
得分:0
int* pInt =(int *)str;//把str强制转换成int*型赋值给 pInt
*(char *)(pInt +1) //先把pInt +1的值转化成char* 型~然后读取其中信息~~
[code]/*~个性签名:bug是什么意思?bug是看上去没有可能的东西实际上是有可能做到的 就是这样~2018-08-08更~*/[/code]
2017-05-23 16:13
2
1/1页
1
参与讨论请移步原网站贴子:
https://bbs.bccn.net/thread-477266-1-1.html
关于我们
|
广告合作
|
编程中国
|
清除Cookies
|
TOP
|
手机版
编程中国
版权所有,并保留所有权利。
Powered by
Discuz
, Processed in 2.052526 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved