Search:

Type: Posts; User: stariz

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,499

    Is a buffer created here?

    So I have an overloaded operator << implemented as follows:


    ostream& operator << (ostream& os, const Position& p)
    {
    os << "(" << p.x << ", " << p.y << ")";

    return os;
    }
  2. Replies
    2
    Views
    1,306

    !(n == 4 && m > 2) becomes !(n == 4) ||...

    !(n == 4 && m > 2)

    becomes

    !(n == 4) || !(m>2) as per De Morgan's law.

    which further becomes

    n !=4 | | m <=2 just by negating the statements.
  3. Why does a getchar() cycle through a string in a while loop?

    I am trying to get a better understanding of how the getchar() function works. I understand that getchar() will wait for a char to be entered and return it. For example:



    char c;

    c =...
  4. Replies
    9
    Views
    10,001

    Thanks everyone for the help; it is more useful...

    Thanks everyone for the help; it is more useful than you know.



    Yah, I was just trying to create a simple example that I could apply to my current project.

    I recently decided to take a...
  5. Replies
    9
    Views
    10,001

    Thanks for the link to the resources! I will be...

    Thanks for the link to the resources! I will be sure to go through the information; however, I just wanted to follow up on what tabstop said to see if I understood. This is what I came up with:

    ...
  6. Replies
    9
    Views
    10,001

    How do you cin parameters?

    How do you create a function that takes user-defined parameters? For example, say I had a function:


    int Example(int x, int y){

    answer = x+y;

    return answer;

    }
Results 1 to 6 of 6