samedi 24 mars 2018

Having trouble changing value in c++

So, I'm new to c++, and one of the problems that I'm having is that my variables don't work as they should. In this instance below, I'm trying to take a user input into 'inputSize' and add it to the size. But it isn't adding the value into size.

int size = 0;

  string name, theme, location, date;

  int inputSize;

  node*head = NULL;

  if (ch == 1)
  {

    cout << "\nEVENT CREATOR";
    cout << "\nWhat is the name of this event?\n";
    cin >> name;
    cout << "\nWhat is the theme of this event?\n";
    cin >> theme;
    cout << "\nWhere is the location of this event?\n";
    cin >> location;
    cout << "\nWhen is this event?";
    cin >> date;
    cout << "\nHow many guests will be invited?\n";
    cin >> inputSize;
    size += inputSize;
  }

Aucun commentaire:

Enregistrer un commentaire