Search:

Type: Posts; User: Ramcin Oudishu

Search: Search took 0.00 seconds.

  1. A variable has to be declared before use

    Hi,

    If a variable has to be declared before use, then why the following code works? Since in the class definition x is declared after its use in f().


    #include <iostream>using namespace std;
    ...
  2. Replies
    3
    Views
    1,110

    Why can't I access the variable?

    Hi,



    #include <iostream>
    using namespace std;

    void f();
    extern int x;
  3. Replies
    6
    Views
    1,015

    In the initialization, is "foobar" an expression?...

    In the initialization, is "foobar" an expression? If it is, then I assume that "foobar" first gets evaluated before a copy of the result is assigned to x. Is my thinking correct?


    If I declare a...
  4. Replies
    6
    Views
    1,015

    Thanks for the response. Is it true to say...

    Thanks for the response.

    Is it true to say that array and &array[0] are not equivalent only when: (1) using sizeof(); (2) using the address-of operator (&); and (3) using array as a l-value.
    Are...
  5. Replies
    6
    Views
    1,015

    Array and Pointer

    Hi,

    When declaring char array[10], memory is allocated for 10 1-bit memory locations. Is extra memory allocated for storing the address of array[0]? In expressions, is array equivalent to a...
  6. Replies
    6
    Views
    738

    Substitute "1" for "true", then is that statement...

    Substitute "1" for "true", then is that statement equivalent to
    { x = 5; } or
    x = 5;
  7. Replies
    6
    Views
    738

    The Scope and If/For Statements

    Hi,



    if(true) x = 5;

    // Is the above code equivalent to this
    { x = 5; }

    // or this?
  8. What is a stream? What really is a stream object?

    Hi,

    My definition of a stream is a sequence of data, but it does not really make sense when thinking about stream objects.

    For example, "cin >> var;" awaits for the user to input something; and...
  9. Replies
    2
    Views
    1,085

    How does a function call work?

    Hi,


    int i = 1;
    void f()
    {
    i = 2;
    }

    int main()
Results 1 to 9 of 9