Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1040995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:17:37+00:00 2026-05-16T15:17:37+00:00

I have data coming over a socket that looks like this: (h)(int,char,float,int,char)(/h)(d)(2,a,1.32,45,d)(3,d,3.45,32,a)(/d) The datatype

  • 0

I have data coming over a socket that looks like this:

(h)(int,char,float,int,char)(/h)(d)(2,a,1.32,45,d)(3,d,3.45,32,a)(/d)

The datatype of the data arriving is dynamic and is only known when the header is received. I then have to create corresponding std::vectors to store the data. In this case, two int, two char and one float vector. I don’t know how to initialize in such a case. Can someone help me out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:17:37+00:00Added an answer on May 16, 2026 at 3:17 pm

    std::vector can’t do this by itself. It sounds like you need something that resembles Boost.Any or Boost.Variant, you’ll need to decide which. If you have a small number of types, a simple union might work as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML document coming in over a socket that I need to
I have a stream of data coming in over the serial line from an
I have data in this format coming from a database... BUS 101S Business and
I have a function that will parse some data coming in. My problem is
I have some values coming from a datasource that I have control over. I
I have a program that is used to talk to hardware over rs232. This
I have this data coming from a REST method using jquery's getJSON method. [Date.UTC(2010,0,0,0,0,0,0),
I have like a million records each of about 30 characters coming in over
I have data coming from an external system (in CSV form). The data contains
I have data coming into my Model, how do I setup to insert the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.