You can see what my first idea was; to use the meta struct I already use for different purposes (not included in post, due to irrelevancy), and store a msg.msgID, but I'm unsure how to traverse through the blockarray, checking for this specific value.
Can anyone give me some input, or even a better solution to my problem?
Please ask if anything is unclear. My mind is kind of clouded atm, so there's a possibility that I'm not making my self sufficiantly understood.
Code:
#include/define whateverneeded
char *block[16];
int blockNmber;
int msgNmber;
struct meta {
int msgID;
};
void newMSG(char *stringArray[])
{
struct meta msg;
block[blockNmber] = malloc(16);
int i;
int j = 0;
for (i=0;i<strlen(stringArray[1]);i++) {
if (j >= 15 {
blockNmber++;
j = 0;
block[blockNmber] = malloc(16);
}
else {
block[blockNmber[j] = stringArray[1][i];
j++;
}
}
blockNmber++;
msgNmber++;
msg.msgID = msgNmber;
}



