Michael Wirta wrote: > I have been having a problem with scanf and floating point numbers in Cygwin > on a WindowsME machine. I have run this same program under Linux
doubt it. see below. > and have > had no problems with it. As soon as the float number is entered the program > terminates abnormally. The error message says there is a "Segmentation > Fault : Probably a corrupted stack." The program I used is below, followed > by the core dump file produced when the program is run. Note: I have not had > any problems with scanf using strings or integers, only floating point > numbers. I saw others mention this problem in the Cygwin mailing list > archive, and someone reported that this bug had been fixed. However, I have > the latest version of Cygwin installed, with the gcc that is included with > the installation. Anyone have any suggestions? > > #include <stdio.h> > > int main(void) > { > float a = 1; > > printf("number a is %f \n",a); > scanf("===>%f",a); should be 'scanf("===>%f",&a);' (note the '&a') > printf("new number is %f \n",a); > exit(0); > } --Chuck -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/