scoping visibility

This is a discussion on scoping visibility within the C++ Programming forums, part of the General Programming Boards category; here is my code Code: . int x = 5 int main() { int x=3; cout<<x; f1(); f2(); f3(); f1(); ...

  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
    moi
    moi is offline
    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, 12:08 AM
  2. Check application visibility
    By 3saul in forum Linux Programming
    Replies: 2
    Last Post: 02-13-2006, 04: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, 12:23 PM
  5. Process visibility
    By SMurf in forum Windows Programming
    Replies: 5
    Last Post: 11-17-2003, 08:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21