N
news.hku.hk
As myfile.txt is the required filename, i try to extract the string
"myfile.txt" to variable "filename" of type char from buffer
i1: position of "m" in "myfile.txt"
i2: position of the last "t" in "myfile.txt"
buffer: a character array containing many words in
********************************************** while(i1 < i2) {
strcat( filename, buffer[i1] );
i1++;
}; *********************************************** The above
lines generate error. I think this is because buffer[i1], buffer[i1+1],
...... are some characters without the ending '\0' and therefore cannot be
used in the strcat function. But is there any ways to achieve my purpose? or
i simply go to a completely wrong direction? Thanks for your kind attention.
"myfile.txt" to variable "filename" of type char from buffer
i1: position of "m" in "myfile.txt"
i2: position of the last "t" in "myfile.txt"
buffer: a character array containing many words in
********************************************** while(i1 < i2) {
strcat( filename, buffer[i1] );
i1++;
}; *********************************************** The above
lines generate error. I think this is because buffer[i1], buffer[i1+1],
...... are some characters without the ending '\0' and therefore cannot be
used in the strcat function. But is there any ways to achieve my purpose? or
i simply go to a completely wrong direction? Thanks for your kind attention.