'Can I turn a string into variables for a struct in C++?
The title pretty much says it all, I was wondering if there is a function to transform a string, specifically one extracted from a .csv file, to values for filling a struct with variables of different types. Thank you very much for your attention.
EDIT: I added the .csv file, and a snippet to understand the variables in it. [1]: https://i.stack.imgur.com/xQcUX.png
'''
struct Line
{
int ID;
string date;
string supplier;
int first_dose;
int second_dose;
int booster_dose;
int sesso_femminile;
int sesso_maschile;
string region;
};
'''
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
