Howdy!
I am working on a project in C using libgnokii (www.gnokii.org) for reading sms from a cell phone, but I'm stuck with a problem that I think is C related rather than a problem with the library. The whole thing is more than a little confusing; I'll try to explain the best I can.
The function used to access gnokii's capabilities is below
Code:
gn_error gn_sm_functions(gn_operation op, gn_data *data, struct gn_statemachine *sm);
The variable "data" is a struct holding pointers to all the
different variables needed for any operation. Before an operation,
it is up to the programmer to fill the pointers of the variables
necessary to complete the operation.
For example, to check the cell phone's battery level:
Code:
...
float battery_level = 0;
data.battery_level = &battery_level;
error = gn_sm_functions(GN_OP_GetBatteryLevel, &data, state);
...
I am having trouble with the specific struct member below.
Code:
typedef struct{
...
gn_sms_message_list *message_list[GN_SMS_MESSAGE_MAX_NUMBER][GN_SMS_FOLDER_MAX_NUMBER];
...
}gn_data;
Is this a pointer to a 2d array? I tried the following
Code:
gn_sms_message_list smsmessagelist[GN_SMS_MESSAGE_MAX_NUMBER][GN_SMS_FOLDER_MAX_NUMBER];
data.message_list = &smsmessagelist;
error = gn_sm_functions(GN_OP_GetSMS, &data, state);
but the second line keeps giving me the error
"error: incompatible types in assignment"
Any Help is greatly appreciated.
-Meredith M.