# # ifndef INTISETTING_H_
# define INTISETTING_H_
#include
#include
Struct Position
{
Double E;
Double N;
Double U;
};
Struct init
{
Int num.
STD: : string filename;
The Position truePosition;
};
//extern init Settings;
//extern void disp (const init & amp; Settings);
# endif
.cpp file
# include "intisetting. H"
Init Settings={500, "GPS_SDR. Bin," {123.3, 456.6, 789.9}};
Void disp (const init & amp; Settings)
{
STD: : cout
. The main file
#include
#include
# include "intisetting. H"
using namespace std;
//extern init Settings;
//extern void disp (const init & amp; Settings);
Int main ()
{
Disp (Settings);
//Settings={12, "SanGuo. TXT", {132.4, 465.7, 798.2}};//???????
Settings. Num=12;
Settings. The filename="SanGuo. TXT";
Settings. TruePosition. E=132.4;
Settings. TruePosition. N=465.7;
Settings. TruePosition. U=798.2;
Disp (Settings);
return 0;
}
Question://Settings={12, "SanGuo. TXT", {132.4, 465.7, 798.2}};//??????? Back to the setting value assignment will appear error: expected an expression
CodePudding user response:
Init Settings={500, "GPS_SDR. Bin," {123.3, 456.6, 789.9}};The syntax structure of the variable is initialized, general assignment I'm afraid not,
CodePudding user response:
One by one ~ ~ ~CodePudding user response: