|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||
|
|||
|
Re: Static Variables
No, there is no need for the declarations function. Just declare the variable outside of all functions. This will make that variable a global variable so it will be available to all the functions in the file. Also the extern int declaration is not needed when the variable is a global variable.
Your code with the above modifications would look like this: Code:
MyFunction.c
int bob=2;
void hi(void)
{
int bill=0;
bill=bob+2;
}
Last edited by JoelP : 02-03-2005 at 19:30. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help with Variables ? | David Bryan | Programming | 5 | 23-02-2004 07:42 |
| Joystick Variables | fred | Programming | 8 | 20-02-2004 10:58 |
| Simple problem with variables | sear_yoda | Programming | 4 | 05-02-2004 09:12 |
| VB Program to monitor robot variables | DanL | Programming | 7 | 15-02-2002 22:35 |