[問題] struct如何使用extern
問題(Question):
我的平台有coreA和coreB,各有main(),在main()內宣告的變數皆使用 L1 記憶體,
(平台記憶體有L1、L2_SRAM、L3_SDRAM)
想在L2_SRAM.h下宣告struct
而在system.h下extern struct,讓在其他.c檔只要#include system.h
就可以使用此struct...但出現錯誤如下,
請問有人知道我的問題出在哪裡嗎...?懇請告知謝謝
<L2_SRAM.h>
struct my_struct
{
int x;
int y;
};
<system.h>
extern struct my_struct MYSTRUCT;
<main.c>
MYSTRUCT.x = 10; //編譯出現錯誤
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.251.198.39
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1440408894.A.D68.html
推
08/24 17:59, , 1F
08/24 17:59, 1F
推
08/24 18:09, , 2F
08/24 18:09, 2F
→
08/24 19:20, , 3F
08/24 19:20, 3F
→
08/24 22:13, , 4F
08/24 22:13, 4F
推
08/24 22:55, , 5F
08/24 22:55, 5F
→
08/25 12:44, , 6F
08/25 12:44, 6F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章