c - I can't use <nameofmystructure>* this as an argument to a function -


this code i'm having trouble with:

typedef const char* sun_date_t; typedef const char* sun_time_t;  typedef struct sun_t {   int luminosity;    /* private */   sun_date_t date;   sun_time_t time;   sun_time_t sunrise;   sun_time_t sunset;    pthread_t tid;   pthread_mutex_t mutex; } sun_t;  void sun_parse_data (sun_t* this, file* f){.....} 

as see, define structure , after try pass pointer "sun_t", compiler says need write ',' or '....' before 'this'. ideas how solve it?

you must compiling c++ since this keyword in c++ in c not not idea use this variable name in case want port code later on.

the code compiles fine c program: see live see same error when attempt compile c++ program: see live:

error: expected ',' or '...' before 'this'


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -