cout << "Add a title << endl;
getline(cin, titles);
cout << "_________________________________________________"<< endl;
cout << ":" << endl;
cout << "filmen " << titles << " har lagts till " << endl;
cout << "Please add the type of movie you want to add: <dvd or blueray>:\n_________________________________________________" << endl;
getline(cin, typ);
cout << "the type " << typ << " has been added " << endl;
for (int i = 0; i < films.size(); i++)
{
if (films[i].titel != titles||films[i].type != titles) //Kontrollera att filmens namn inte redan finns i registret.
{
cout << endl;
}
if (typ != ("dvd") == 0 || typ != ("blueray") == 0)
{
films.push_back(Film(titles,typ));
}
else if (typ == ("dvd") == 0 || typ == ("blueray") == 0)
{
films.push_back(Film(titles,"undefined"))
cout << "Type ok is renamed to'undefined'" << endl;
}
else if (indx == -1)
{
cout << "test";
}
i=films.size();
}
if (typ != "dvd" || typ != "blueray") should fix it. Same for the else if. You might want to read about if/else statements in the reference in the side bar over there. <---
If the intention is to do something if typ is equal to either "dvd" or "blueray", and something else if it isn't so, there is no need to specify the condition twice (in both the if and else block). Just put it once, and the else will take care of the condition where it is false.
Also, if this is one condition: if (typ == "dvd" || typ == "blueray")
then the inverse condition is this: if (typ != "dvd" && typ != "blueray")
Notice the use of && in the second case. But like I said, you don't need both.