Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Use of static in functions

Reply
Thread Tools

Use of static in functions

 
 
Halid Umar A M
Guest
Posts: n/a
 
      05-01-2006
Dear All,
Please help me to understand the use of static in a function.
What is the use of a function to be static in a module? For example in
a network applications there will be a common function to convert the
address to decimal dotted notation. It can be written as
static char *addr_to_dotted(unsigned long int addrp){ }

what is the use of static there? Please explain me.

Regards,
Halid Umar

 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      05-01-2006
"Halid Umar A M" <> wrote:

> Please help me to understand the use of static in a function.
> What is the use of a function to be static in a module? For example in
> a network applications there will be a common function to convert the
> address to decimal dotted notation. It can be written as
> static char *addr_to_dotted(unsigned long int addrp){ }
>
> what is the use of static there? Please explain me.


Your teacher, or your textbook, should have explained this.

It means that that declaration will not be visible outside that
translation unit.

Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Static functions and C++ member functions mafiQ C++ 0 04-22-2009 08:33 PM
Static inline functions with static local variables Martin Wells C Programming 10 10-08-2007 03:38 PM
lvalue difference between static and non static member functions tkrogc@gmail.com C++ 9 02-06-2006 02:06 PM
static and non-static functions Victor Bazarov C++ 4 04-02-2005 04:15 AM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57