This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你(们)好
我使用 controlSUITE 中的 DPlib。 我位于接下来声明的 main.c 文件中:
#pragma DATA_SECTION (CNTL_2P2Z_CoefStruct1、"CNTL_2P2Z_Coef");
#pragma DATA_SECTION (CNTL_2P2Z_CoefStruct2、"CNTL_2P2Z_Coef");
struct CNTL_2P2Z_CoefStructCNTL_2P2Z_CoefStruct1;
struct CNTL_2P2Z_CoefStructCNTL_2P2Z_CoefStruct2;
接下来、我想访问另一个 xxx.c 文件中已声明的变量。 如何更正在另一个文件中声明的内容?
同样的问题和
SineAnalyzer sine_mainsV = SineAnalyzer_defaults;
我需要访问 另一个 xxx.c 文件中的 sine_mainsV。 我该怎么做?
您好!
您必须在两个.c 文件包含的头文件中对结构进行原型设计、以便在您的情况下在头文件中进行声明
extern struct CNTL_2P2Z_CoefStructCNTL_2P2Z_CoefStruct1; extern struct CNTL_2P2Z_CoefStructCNTL_2P2Z_CoefStruct2;
因此、您可以按照在一个.c 文件中所示对其进行定义、但仍可以在另一个.c 文件中使用它