请选择 进入手机版 | 继续访问电脑版

普中开源电子分享网

 找回密码
 立即注册
搜索
查看: 2026|回复: 0

定义全局指针并赋地址出错 请高手解决

[复制链接]

1

主题

1

帖子

14

积分

新手上路

Rank: 1

积分
14
发表于 2019-6-14 14:27:11 | 显示全部楼层 |阅读模式
struct GPIO32
{
        uchar        p0:1;
        uchar        p1:1;
        uchar        p2:1;
        uchar        p3:1;
        uchar        p4:1;
        uchar        p5:1;
        uchar        p6:1;
        uchar        p7:1;
        uchar        p8:1;
        uchar        p9:1;
        uchar        p10:1;
        uchar        p11:1;
        uchar        p12:1;
        uchar        p13:1;
        uchar        p14:1;
        uchar        p15:1;
        uchar        p16:1;
        uchar        p17:1;
        uchar        p18:1;
        uchar        p19:1;
        uchar        p20:1;
        uchar        p21:1;
        uchar        p22:1;
        uchar        p23:1;
        uchar        p24:1;
        uchar        p25:1;
        uchar        p26:1;
        uchar        p27:1;
        uchar        p28:1;
        uchar        p29:1;
        uchar        p30:1;
        uchar        p31:1;
};
struct GPIO32  * actr;
actr= (GPIO32 *)(0x6f80);
头文件中定义一个全局指针 actr并赋值 编译器出错Description        Resource        Path        Location        Type
#148 declaration is incompatible with "struct GPIO32 *actr" (declared at line 138)        Dsphead.h        /HelloWorld/User        line 148        C/C++ Problem
actr= (GPIO32 *)(0x6f80);放入main函数过程里编译没问题
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

Archiver|手机版|小黑屋|普中开源电子分享网 粤ICP备16123577号-2

GMT+8, 2024-3-28 17:07 , Processed in 0.080312 second(s), 30 queries .

Powered by 论坛搭建 X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表