Thread: local variables

  1. #1
    Unregistered
    Guest

    local variables

    i have to fill in a true or false in a question:
    Functions can have local variables. Is this true or false??I think it 's false because functions always have local variables.

  2. #2
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    ?? then it must be true then??
    Visit entropysink.com - It's what your PC is made for!

  3. #3
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    It's true....

    You think it's false that functions can have local variables because they always have local variables? Huh?

  4. #4
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Or expressed as a boolean function......

    Its not not true that (if functions can have local variables) OR (functions always have local variables) then functions have local variables.
    Visit entropysink.com - It's what your PC is made for!

  5. #5
    Unregistered
    Guest
    and what about this one:local variables exists during the hole program.True or false

  6. #6
    Unregistered
    Guest
    another one: parameters can be reached from different functions

  7. #7
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Oooooooohhhhhh nice try!

    50 bucks and I'll do all the homework for you!
    Visit entropysink.com - It's what your PC is made for!

  8. #8
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    What's a hole program?

    Is that like for drilling companies and stuff? I don't know much about that.

  9. #9
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Perhaps one with a loop in it?
    Visit entropysink.com - It's what your PC is made for!

  10. #10
    Unregistered
    Guest
    sorry,had to be whole.

  11. #11
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    > Perhaps one with a loop in it?

    You sure? I heard the drilling industry's getting its hands deeper and deeper into the software industry lately. Something having to do with Gates's father being a miner...

    Unreg: We're not going to do your homework.

  12. #12
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    522
    >>Unreg: We're not going to do your homework.

    [sarcasm]
    I am. Its not like I have anything else to do
    [/sarcasm]
    All spelling mistakes, syntatical errors and stupid comments are intentional.

  13. #13
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    >I think it 's false because functions always have local variables.

    Code:
    void function (void)
    {
        /* I have no local variables, am I a function? */
    }

  14. #14
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823

  15. #15
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    > Functions can have local variables. Is this true or false??I think
    > it 's false because functions always have local variables

    Did you even READ this question?

    "True or false: Functions can have local variables."

    Um...
    Code:
    int main( void )
    {
        int OhMyGodIAmALocalVariable;
    }
    Likewise, you've never seen the classic 'hello world' program?

    Code:
    int main( void )
    {
        return printf( "Hello world!" );
    }
    There are no local variables.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Father and Son Variables
    By khdani in forum Linux Programming
    Replies: 3
    Last Post: 11-28-2008, 06:42 PM
  2. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 03:25 AM
  3. how to access local variables outside loops?
    By cdkiller in forum C++ Programming
    Replies: 3
    Last Post: 09-28-2006, 06:48 PM
  4. regarding variables.
    By kiranck007 in forum C Programming
    Replies: 2
    Last Post: 01-24-2006, 07:30 AM
  5. global and local variables
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 10-02-2001, 01:17 PM