Home > Software engineering >  The vector container can replace buff pointer?
The vector container can replace buff pointer?

Time:09-19

Using CFile: : Write ()
The first argument for the pointer to a memory buffer
The second parameter for the size of the write

Existing vector container to store the data to the data written to the file within the container, debugging can write so many times, & amp; Vector [0], the vector data () is used, is unable to succeed

CodePudding user response:

I'm fine,
STD: : vector data;
Int * p=NULL;

Data. The push_back (1);
Data. The push_back (2);
Data. The push_back (3);
Data. The push_back (4);
Data. The push_back (5);

P=data. The data ();

Memory is a continuous 12345

In what ways do you open the file? Should be binary

CodePudding user response:

STD: : vector Can replace char * buff
  • Related