yes, probabilly I’m the worst when I try to explain myself…eheh
so, I know that problems with strings are not from the O.S… I try to explain what’s inside my head but I think you will miss everything (me dog, I can just bark and scratch some code
)
however I solved my original problem…now I’ve got another problem but the code is very long.
I must read some strings.
made other strings using strcat() in a particular way.
log everything in a file.
very simple, I know.
everything is a little bit harder bcause I must read the strings from 14 HW ports at the same time, but using the pthread family is not so hard.
to not lose (???) infos, I store all the things read, in a queue, which is in a thread and simply take strings (when it make sense) and put into a file.
now, when I extract the first element from the queue to log into the file, I see that it is not the same I put inside…or better, the second part is right, the first not (e.g. “/dev/ser1 - message 1” → “/devHç1°5°- Message 1”)
this is done:
(I miss everything not very very important)
[code]char* msg = “a random message”
char* dev = “/dev/ser1”;
char* newmsg;
strcpy (newmsg, dev);
strcat (newmsg, " - ");
strcpy (newmsg, msg);
[/code]
the queue is a class so it’s more easy to control.
class coda {
char* msg[80]; //where incoming messages are stored
};
int coda::Insert(message) {
strcpy(msg[index], message); //where index is the firs free location in the queue
}
the remove functin is
char* coda::Remove(){
char* message = msg[index];
//some IF
msg[index] = NULL;
}
(everywhere is needded there are some IFs to prevent errors.)
write this, I think there aren’t particular problems but it is not true at all…
probabilly You don’t have understand nothing of what I sayd!! If i write in a too wrong english don’t waste time in replys…
bye
P.S. You have 15 years of experience…I’m just 20… 