Search:

Type: Posts; User: Elysia

Search: Search took 0.53 seconds.

  1. Replies
    17
    Views
    1,832

    If room is a vector, then you should consider...

    If room is a vector, then you should consider using push_back. Depending on whether you want rooms to exist without customers, either solution may be preferable.
  2. Replies
    17
    Views
    1,832

    >>ifstream infile; ...

    >>ifstream infile;
    >>infile.open("input.txt");
    Simplify to
    ifstream infile("input.txt");

    >>if (infile.is_open)
    Don't forget parenthesises!
    if (infile.is_open())

    >>while (infile.eof() ==...
  3. Replies
    17
    Views
    1,832

    Switch statement requires braces: switch...

    Switch statement requires braces:

    switch (expr)
    {
    case A:
    case B:
    // etc
    }
    You probably want to pass your room by const reference, also.
  4. Replies
    17
    Views
    1,832

    There are two problems: - The first is that you...

    There are two problems:
    - The first is that you declared the function as bool isSmoking (int n), but defined it as IsSmoking (notice the leading capital letter). Remember that C++ is case sensitive!...
  5. Replies
    17
    Views
    1,832

    What error? Btw, your code basically boils...

    What error?

    Btw, your code basically boils down to:

    bool IsSmoking (int n) { return (n <= 20); }
Results 1 to 5 of 5