Go to Post Because you know what they say, the new year doesn't begin until Dean, Dave, and Woodie drop the big one. - Jay Trzaskos [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 01-03-2005, 23:17
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
Static Variables

If I want to define a variable inside of a function and want it to be available to all functions in the .c file, will static do it?

Would this work?

void FunctitonWhatever1(void)
{
static int bob=1;
/*Note the static and the =1*/
CallerFuction();
}

void CallerFunction(void)
{
int bill=0;
/*Only need it in this function*/
bill=2+bob;
}
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 03:00.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi