Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
How can I convert this struct structure into class of c++?struct rwlock
{
#ifdef RWLOCK_DEBUG
pthread_key_t key;
#endif
pthread_mutex_t lock;
pthread_cond_t rcond;
pthread_cond_t wcond;
int lock_count;
int waiting_writers;
};#ifdef RWLOCK_DEBUG
struct LockPos
{
int type;
char *file;
int line;
pthread_key_t key;
};
#includestruct rwlock;
typedef struct rwlock *rwlock_t;#define RWLOCK_DEBUG 2
void rwlock_Init(rwlock_t rwl);
rwlock_t rwlock_InitFull(void);void rwlock_WriteUnlockD(rwlock_t rwl, char *f, int l);
void rwlock_ReadLock(rwlock_t rwl);
void rwlock_ReadUnlock(rwlock_t rwl);Any help would be greatly appreciate.
Thanks.

That was easy... wasn't it? :)
Or you could keep the struct and add the class syntax... methods and such... and save it into a .h or something.

Might I add on. If you're planning on keeping all of your members public, you may as well leave it as a structure. We can't tell you how to convert it to a class, because first off, we don't know what members you want private and what members you want public.
- Rolos

![]() |
How do I set up web direc...
|
systray callback
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |