预期';' 在数字常量之前

Ran*_*lue 2 c

编译以下程序时,我收到错误expected ‘;’ before numeric constant .我究竟做错了什么?

#include <stdio.h>

#define GPIOBase 0x4002 2000

uint32_t * GPIO_type(char type);

int main(void)
{
    GPIO_type('G');

    return 0;
}

uint32_t * GPIO_type(char type)
{
    return (uint32_t *) GPIOBase;
}
Run Code Online (Sandbox Code Playgroud)

Moo*_*ice 7

问题是:

#define GPIOBase 0x4002 2000

在哪里使用它:

return (uint32_t *) GPIOBase;

变为:

return (uint32_t *) 0x4002 2000;

哪个是编译器错误.2000在你之后有一个流浪的徘徊0x4002.我怀疑你想要:

#define GPIOBase 0x40022000