-5

I got something like this

int main(){
    char N[20];
    int day,month,year,hour,minute,length;
    char group[30],description[100];
    std::cin>>N;
    std::ifstream data(N);
    while(!data.eof()){
    data>>day>>month>>year>>hour>>minute>>length>>group>>description;
    }
return 0;
}

and i got data in file in this form

23 12 2017 19 25 88 bussiness meeting meeting about new product

it's no problem to put integers into variables but i want to put "bussiness meeting" into group and "about new product" into description and the same thing while saving data in file.

Jean-François Fabre
  • 126,787
  • 22
  • 103
  • 165

1 Answers1

0

Add " before and after group and description strings. But you need to know that if you going to want to load it, you going to need to parse it somehow. As other people said use std::string with C++

Damian
  • 26
  • 2