Thread: scoping visibility

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    14

    scoping visibility

    here is my code

    Code:
    .
    
    int x = 5
    
    int main()
    {
    int x=3;
    cout<<x;
    
    f1();
    f2();
    f3();
    f1();
    f2();
    f3();
    }
    void f1();
    }
    
    intx=7'
    x++
    cout<<x;
    }
    void f2();
    }
    x++;
    cout<<x;
    }
    void f3();
    {
    static int x=10;
    x++;
    cout<<x;
    }
    i get the output of the first 4 functions, and i know that static retains its value, but when i get to the fith output i get lost and don't know were to start again, please help.
    thanks

  2. #2
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    Make sure the code can be compiled before you post.
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

  3. #3
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    indeed, with all those typos i cant be quite sure what you're doing
    hello, internet!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ensuring Toolbar Visibility
    By SMurf in forum Windows Programming
    Replies: 1
    Last Post: 03-17-2006, 01:08 AM
  2. Check application visibility
    By 3saul in forum Linux Programming
    Replies: 2
    Last Post: 02-13-2006, 05:13 PM
  3. Errors: ISO scoping, obsolete binding??
    By -JM in forum C++ Programming
    Replies: 3
    Last Post: 10-28-2005, 08:56 PM
  4. Method/Functions Names Visibility with SoftIce
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 03-19-2004, 01:23 PM
  5. Process visibility
    By SMurf in forum Windows Programming
    Replies: 5
    Last Post: 11-17-2003, 09:00 PM