Hi, i was wondering if there is a way to remove the element of an array. For example, in the following code i am using the one array to temporarily store multiple sets of data. The problem is that if the previous string was longer, it appends the current string. Each string is separated by commas.
so if i had the string "123", and the next string was "ab", the resulting output would be "ab3". Is there any way for me to remove the trailing characters? I know i can use a for loop and the length of each string to omit the unwanted characters but that's not my question.Code:for (x=0,j=0;x<i;++x) { if (line[x]!=',') { tmpNum[j]=line[x]; ++j; }else { printf("%s\n",tmpNum); j=0; //this is where i "reset the array" } }