Im working c++ for school and simply cannot understand why after my inputs, it ignores first word. I've tryed already to find solution here, cause i saw topics about it, but non of them helped me. Simply, only first input is ok. All others are missing 1 word at beginning.
Here is the code:
void vozilo::Unos() {
// Marka vozila
cout << "Unesite marku vozila (do 50 karaktera): ";
markaVozila = new char[50];
cin.ignore();
cin.getline(markaVozila, 50);
// Broj sasije
cout << "Unesite broj sasije (do 20 karaktera): ";
brojSasije = new char[20];
cin.ignore();
cin.getline(brojSasije, 20);
cout << endl << endl;
}
https://pastebin.com/hkLW77HX - full code.
And here is what is the problem