Subj : Re: How to in C or C++....? To : borland.public.cpp.borlandcpp From : "Ed Mulroy [TeamB]" Date : Sat Aug 09 2003 01:11 am ------------------ #include #include : char buf[132]; // buffer to receive the line dataq char *p; // pointer used for searching FILE *fp = fopen("filename.txt", "r"); // open the file in text mode fgets(buf, sizeof(buf), 1, fp); // read the line in p = strchr(buf, '\n'); // look for the end of line (the '\n' or linefeed) if (p != NULL) // if one was found (if there, it will be the last char) *p = '\0'; // end the string before the '\n' ------------------ > Joseph wrote in message > news:3f3436f9$3@newsgroups.borland.com... > > Could anybody help me with making a string from a char array > in C, for instance, when reading from a file, I want to make a > whole line a string except for a linefeed(10). .