I'm doing an assignment where we aren't allowed to use strings, we have to use char arrays. This is my code:
cout << "Enter Album name: ";
cin >> CDdata[count].title;
fout << CDdata[count].title;
cin.getline(CDdata[count].title, 1000). The second parameter is the length of your char array,
The above function either reads 1000 characters or until it finds a delimiter, which is by default a newline (
\n) but can be changed as follows.
cin.getline(CDdata[count].title, 1000, ',') //delimiter is changed to ','
If you want a more formal description, read here.
P.S: I have used 1000, second argument, as a placeholder. You should change it accordingly.