Hi. How can i push into the same vector types of string and integer too ?
vbx_wx
-6
Junior Poster
Recommended Answers
Jump to PostYou can't! I supposed you could convert the int's to strings and push them all in as strings. What are you trying to do? I bet there is a better way.
Dave
Jump to Post(Please use real words, e.g. "you" vs "u" as well as capitalize the first word of a sentence. It helps keeps the forum looking professional!)
I would suggest creating a struct.
struct YourStruct { int YourInt; string Name; string Country; string City; };
You can populate …
Jump to Post> I highly recommend you use read & write methods to store these data.
If any of the members are not POD, it is undefined behavior. If the file was written by a different program, padding between struct members might not be the same and memory corruption can happen. Lastly, …
All 12 Replies
daviddoria
334
Posting Virtuoso
Featured Poster
vbx_wx
-6
Junior Poster
daviddoria
334
Posting Virtuoso
Featured Poster
vbx_wx
-6
Junior Poster
vbx_wx
-6
Junior Poster
daviddoria
334
Posting Virtuoso
Featured Poster
nbaztec
45
Posting Pro in Training
daviddoria
334
Posting Virtuoso
Featured Poster
vbx_wx
-6
Junior Poster
daviddoria
334
Posting Virtuoso
Featured Poster
nbaztec
45
Posting Pro in Training
Radical Edward
301
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.