Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
配列を mplab c18 でグローバルとして宣言しようとしましたが、あまり成功しませんでした。配列要素にアクセスする方法はありますか、または配列をグローバル /extern として宣言し、他のソース ファイルからアクセスできますか。
1つのファイルで配列を宣言できます
char chMyArray[50];
そして、他のファイルでは、次の方法でアクセスできます
extern char chMyArray[];
extern を実行するときは、配列にいくつのスペースを入れないことが重要です。[] を使用しても問題ありません。