From: fwibbly AT earthlink DOT net (Paul Wilson) Subject: B20: fgets() again. (Enter isn't enter!) 6 Dec 1998 14:41:14 -0800 Message-ID: <366AC82B.C9DF9A0C.cygnus.gnu-win32@earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: gnu-win32 AT cygnus DOT com I found that using ^J instead of enter gives the correct results. Take this small bit of code: #include char string[5]; char *fgets_ptr; int main() { fgets_ptr = fgets(string, sizeof(string), stdin); string[strlen(string)-1] = '\0'; printf("fgets_ptr is %s and string is %s\n", fgets_ptr, string); return(0); } Yeilds this when using "Enter" to execute it: BASH.EXE-2.02$ ./fgetstest.exe fgets_ptr is and string is But yeilds this when using ^J: BASH.EXE-2.02$ ./fgetstest.exe^J asd fgets_ptr is asd and string is asd Paul - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".