#include <stdio.h>
#include <stdlib.h>
int main()
{
char str1[27]="a";
char str2[2];
int n;
str2[1]= 0;
for (n = 'a' ; n < 'j' ; n++)
{
str2[0] = n;
strcat(str1, str2);
printf( "%s\n ", str1);
}
}
'strcat' ing is fun but situation become worse when you need to remove the 'strcat' ed string. The above code is just a simulation of my actual code. I had used strcat to make a header of packets. Of course at the receiver end, you have to remove the header. How do I actually do it? I tried to remove the header by just ignoring the first few bytes which represents the header, it's ok to do so? But I found disadvantage by doing so because if I ignored the header, then the computer will not know which packets is which! Please help!