How define array type with 4 elements?
How can I define type MARKS which will be able to hold 4 elements just like array? I want to access it just like normal array elements using brackets []. In the following struct I want to use such type.
Code:
typedef struct {
MARKS ** pointers;
} ARGUMENTS
void main(){
ARGUMENTS arguments;
arguments[counter][0]; // type char *
arguments[counter][1]; // type char *
arguments[counter][2]; // type char *
arguments[counter][4]; // type char *
}
Yet I am not sure with the type char *
Purpose of the struct ARGUMENTS is to hold 4 pointers to string. I want to mark few positions in string so I can simple access them. E.g. name=John
Code:
arguments[0][0]=0; // begin of the param name
arguments[0][1]=3; // end of the param name
arguments[0][2]=5; // begin of the value
arguments[0][3]=8; // end of the value
I mean not to save int but the pointer to the corresponding position.