0

My input stream is going to read something like this

2020-11-06,00:20:44,98273,19.94,9,Corn

2019-11-08,13:04:43,96241,15.05,5,Fish

I'm trying to ignore the commas in my code. Obviously I have alot more going on but I am just trying to get ideas in how to combat this problem. I've seen ways of doing it with a while loop but I am unsure if that is something I can do here or even how to. Just looking for something simple to help me continue this problem. Thanks.

#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

 int main() {


     int dayOfWeek;

     while (cin >> dayOfWeek) {
         int year;
         int month;
         int day; 
         int hour; 
         int minute; 
         int sec;
         char del1;
         char del2;

         double jd;
         int wd;

         cin >> year;
         cin.get(del1);
         cin >> month;
         cin.get(del2);
         cin >> day;
         cin.get(del3); ///This is what I want to do
}  
ripsly25
  • 19
  • 3
  • Does this answer your question? [Read comma separated integers from getline()](https://stackoverflow.com/questions/63063814/read-comma-separated-integers-from-getline) – kiner_shah Nov 09 '21 at 06:15

0 Answers0