Home > Software engineering >  MFC used in VECTOR data missing problem
MFC used in VECTOR data missing problem

Time:10-01

The experimental data. Dat is such
But with the size of the VECTOR statements test only one data why


Float temp;
CFile file;
File. The Open (_T (" F: \ experiment data. Dat "), CFile: : modeRead);
CArchive ar (& amp; The file, CArchive: : load);
Ar & gt;> Temp.
Int count=data_vector. The size ();
Data_vector. Push_back (temp);
CString str;
STR. The Format (_T (" % d "), the count);
SetDlgItemText (IDC_EDIT1, STR);

CodePudding user response:

I only see you push_back once, isn't only one?

CodePudding user response:

reference 1st floor cvbtvbwu response:
I only see you push_back once, isn't only one?




So is there any way to use only one statement pushback in the vector

CodePudding user response:

Try to CArray

CodePudding user response:

refer to the second floor darren4567 response:
Quote: refer to 1st floor cvbtvbwu response:

I only see you push_back once, isn't only one?




So is there any way to use only one statement pushback to vector?


No, only a a pushback

CodePudding user response:

Again I ask you how to put these data every number respectively in the VECTOR container in our great god ask

CodePudding user response:

Your data are separated by a space, can then read stringstream
Stringstream ss;
String STR.
Ss> STR;
Come out to put them in verctor data analysis

CodePudding user response:

refer to 6th floor hurryboylqs response:
your data are separated by a space, can then read stringstream
Stringstream ss;
String STR.
Ss> STR;
By data analysis out put them in verctor



In later shows are not allowed to use an incomplete type is what mean?

CodePudding user response:

I can tell you with CStdioFile cooperate to sscanf again with? You don't keep to sister I, who do you want to?

CodePudding user response:

At first glance the c + + cin, cout, ifstream ofstream, istringstream, ostringstream in the input and output on the scanf than c, printf, fscanf, fprintf, fread and fwrite, sscanf, sprintf simple, need not format control characters!
But no format control characters, input and output is the format when you expect to say; When the input and output is not your desired format, you will feel or a format control characters more convenient, more,
Abandon the cin, cout, ifstream ofstream, istringstream, ostringstream!
Use the scanf printf, fscanf, fprintf, fread and fwrite, sscanf, sprintf,