Xref: utzoo alt.religion.computers:2546 comp.windows.ms.programmer:3255 Newsgroups: alt.religion.computers,comp.windows.ms.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!news.arc.nasa.gov!haven.umd.edu!socrates.umd.edu!uc780.umd.edu!coates From: coates@uc780.umd.edu Subject: RE: ap, Windows BASIC Message-ID: <22JUN91.11452508@uc780.umd.edu> Sender: news@socrates.umd.edu (News) Organization: The University of Maryland University College References: <1991Jun20.034205.2661@maverick.ksu.ksu.edu> <7451@vela.acs.oakland.edu> <1991Jun22.040758.9453@maverick.ksu.ksu.edu> Date: Sat, 22 Jun 1991 11:45:25 GMT In a previous article, rogerhef@matt.ksu.ksu.edu (Roger Heflin) wrote: >In <7451@vela.acs.oakland.edu> awesley@vela.acs.oakland.edu (WESLEY ANTHONY >) writes: > >>This is great stuff! Is this going to rec.humor.funny? How do I >>force QBasic to flag an undeclared variable as an error. If I mistype >>a long variable, no error message, just a new variable. Didn't everyone >>figure out this was a Bad Feature (TM) in a programming language way >>back around FORTRAN-66 or so? > >Can you find me a language that will warn you if you mistype a variable? >Without using something like lint. C assumes you knew what you were doing. >Is QB wrong for making that assumption, at least QB doesn't let you mix >your strings and numeric variables up. By default C has that Bad Feature >that you mentioned. >-- >Rogerhef@Matt.ksu.ksu.edu Roger Heflin > EECE Grad Student > (913) 532-5600 In MS C 5.1 with the strictest checking level you can not declare and use an identifier simultaneously. I don't use the lower checking levels, but I'm pretty sure you can't do it that at those levels either. You can not simply assign an int or float to a char in C, or vice versa.. You can cast an int to a char, but you do so explicitly. ch = fgetc(file); // gets int of character from file fn_buf[i] = (char)ch; // assigns charcter to ith place in // string array ************************************************************************** * Elliott Coates, washington dc * * coates@uc780.umd.edu * * coates@uc780.bitnet * **************************************************************************