Re: "private" methods in C
I always thought there were private methods in C++, but maybe I'm wrong.
Re: "private" methods in C
Oh, you said C. Sorry. You're probably right about not including it in the header file. That would probably do the trick.
Re: "private" methods in C
Marking a function "static" will make it visible only to the file it's declared in; so if you mark a function in your .c file static, only functions that .c file should be able to reference it.
Re: "private" methods in C
Quote:
Originally Posted by sunburnt
Marking a function "static" will make it visible only to the file it's declared in; so if you mark a function in your .c file static, only functions that .c file should be able to reference it.
Isn't strtok static?
Re: "private" methods in C
Quote:
Originally Posted by alkatran
Isn't strtok static?
I don't think so, since you must include a .h file (string.h) to use strtok.
Now, it might use static variables inside of it, but a static variable declaration (inside a function) is different from a static function definition and a global static variable.