# include & lt; Iomanip>//STD: : setprecision
# include & lt; Fstream>
# include & lt; Cmath>
# include & lt; String>
# include & lt; Sstream>
# include & lt; Vector>
# include & lt; Map>
# include & lt; Set>
# include & lt; Algorithm>
# include & lt; Random>
# include & lt; Chrono>
# include & lt; Time. H>
# include & lt; List>
using namespace std;
Typedef struct {
Int N, M, C;
Vector
Vector
Vector
Vector
Vector
Vector
} * UserData;
# define CMax 5
Vector
Int main ()
{
The UserData data;
Data=https://bbs.csdn.net/topics/(UserData) malloc sizeof (* data);/* the Allocate data memory */
Cname. Push_back (1);
Data - & gt; N=3;
Data - & gt; M=4.
Data - & gt; C=5;
Data - & gt; Csize. Push_back (1);
Free (data);
return 0;
}
The above application in data - & gt; Csize. Push_back (1); Make a mistake, which help bosses can see reason
CodePudding user response:
Data=https://bbs.csdn.net/topics/(UserData) malloc sizeof (* data);====& gt; To data=https://bbs.csdn.net/topics/new UserData
CodePudding user response:
After the operation showed error (activity) E0513 "UserData *" type of value can not be assigned to "UserData" types of entitiesCodePudding user response:
Wrong, sorryCodePudding user response:
Typedef struct {Int N, M, C;
Vector
Vector
Vector
Vector
Vector
Vector
} * UserData;
==="
Directly into a
Struct UserData {
Int N, M, C;
Vector
Vector
Vector
Vector
Vector
Vector
};
The UserData * data=https://bbs.csdn.net/topics/new...
In c + + is a good idea to put the basic syntax is familiar with c + +
CodePudding user response:
Thank you, a successCodePudding user response:
If you don't change the struct definition, have other remedial method