Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
question about 'static' definitions
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Malcolm, post: 2414678"] It very frequently happens that you only want to expose certian functions to the outside world. For instance one of my files does clustering. It uses the kmeans algorithm, so I want the caller to be able to call the function called kmeans(). Internally the algorithm needs a cluster structure that conints a list of members and centroids, which the caller doesn't need to know about. Also, it doesn't make sense for him to call any of the subroutines directly. By making the subroutines "static" I can use a simple name like "assign" without any danger of a name clash, and also I know that I can modify the functions to my heart's content, as long as I still provide a list of clusters for the call to kmeans(), without breaking anything else. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
question about 'static' definitions
Top