![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 22
Rep Power: 0
![]() |
I started studing C last monday so please don't acuse me for a too stupid way. Yesterday I wrote a "library" to read and write ini files which is ok. But in the h file I have a few functions that are used internally. Is there a way to make them unavailable to the other files that use this c file(like declaring them private as in VB)?
Thanks in advance |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
If you write the library as a class, you can have public and private sections.
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2005
Posts: 22
Rep Power: 0
![]() |
can you do this in c? and how do you do it? I tried this function decleration in the .h file and it didn't work out
private char *clearchar(char *string, char *what); |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
You have to use a C++ class to do it, like this:
class OmgWtf {
public:
int yey;
char grr;
OmgWtf();
protected:
~OmgWtf();
private:
nottobeseen();
};Bad example, but I think you get the idea. I suggest you learn more C first before you get into C++ classes. They're not that difficult though. And, just from my point of view, you should only use a class when it's needed (such as a game or large scale application.) Since it'll bloat your applications a bit. Last edited by Mad_guy; Apr 4th, 2005 at 7:52 AM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|