|
From: metalseb <met...@fr...> - 2002-10-01 07:15:53
|
The error occurs at : while (fs!='.') strncpy(ls, fs, 1); ls is a string (In C point of view) and fs is a char. Char is not a string. You must consider strings as arrays of char. Arrays are seen like pointers to allocated memory in C. And char is a one-byte implementation of int. strncpy wants two pointers to arrays of char as first two parameters. You pass one pointer and one char (one int). Didn't tried this, but you should write : while (fs!='.') strncpy(ls, (char*)&fs, 1); Although getting an index initialised to 0 at the beginning of the loop and making loop look like this : while (fs!='.') ls[index++]=fs; ls[index]='\0'; Would be much better IMHO. Kind regards -- Seb |