Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!wasatch!cmos.utah.edu!jacobs From: jacobs%cmos.utah.edu@wasatch.utah.edu (Steven R. Jacobs) Newsgroups: comp.sys.ibm.pc Subject: Re: Turbo-C bug Message-ID: <1956@wasatch.utah.edu> Date: 30 May 89 23:02:11 GMT References: <2556@Portia.Stanford.EDU> Sender: news@wasatch.utah.edu Distribution: na Organization: University of Utah CS Dept Lines: 28 In article <2556@Portia.Stanford.EDU> hobbes@Portia.Stanford.EDU (Andrew Zimmerman) writes: >The following program doesn't run when compiled under Turbo-C 2.0. >(It does compile under Turbo-C, and it runs under Zortech C.) >Does anyone know if you can explicitly tell Turbo-C 2.0 to link in >the floating formats? I don't know about explicitly, but you can fake out the compiler as shown in the modified example below. I've seen problems similar to this in Turbo-C 1.5 as well as 2.0, and they have problems getting it right with structures that have float/double elements. #include main() { double a[3][3], tc_kludge; int i; i = 1; scanf("%lf", &tc_kludge); a[i][1] = tc_kludge; printf("a[1][1] = %lf\n",a[1][1]); } This trick need only appear at one point in the program, so luckily you don't need to modify all 18,324 scanf() calls :-) Steve Jacobs ({ihnp4,decvax}!utah-cs!jacobs, jacobs@cs.utah.edu)