Path: utzoo!mnetor!uunet!husc6!think!ames!pasteur!ucbvax!KL.SRI.COM!STEINBERGER From: STEINBERGER@KL.SRI.COM (Richard Steinberger) Newsgroups: comp.os.vms Subject: 2 C questions Message-ID: <12387779883.20.STEINBERGER@KL.SRI.COM> Date: 4 Apr 88 15:07:16 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 21 C vs. Fortran speed: Since C variables are automatic (i.e., dynamic) by default and Fortran variables are static, is it fair to conclude that in general, a routine in C having the same number of local variables as a "roughly identical" Fortarn routine will take a bit longer because the OS must allocate (and deallocate) space for the local variables? If the C local variables are made static, does this possible performance advantage disappear? In Fortran, it is sometimes convenient to use the END=n, where n is a label number, in a READ statement to transfer control when an EOF is detected. Has anyone found a *simple* way to get the same effect in C? I had been fopen on TT:, then using a while (!feof(fptr)) {...}, but this still results in the loop body getting executed unless yet another foef() is put within the loop to "double" check for EOF. Thanks for any help or suggestions. -Ric Steinberger steinberger@kl.sri.com -------