SlowMotionFred
August 25th, 2004, 07:35 PM
I have to translate some legacy FORTRAN 77 code to C. Is the "static" keyword in C the same as the "SAVE" keyword in FORTRAN? Thanks.
|
Click to See Complete Forum and Search --> : FORTRAN 77 to C SlowMotionFred August 25th, 2004, 07:35 PM I have to translate some legacy FORTRAN 77 code to C. Is the "static" keyword in C the same as the "SAVE" keyword in FORTRAN? Thanks. SOCM_FP_CPP August 26th, 2004, 01:47 AM Hi , > >I have to translate some legacy FORTRAN 77 code to C. Is the "static" keyword >in C the same as the "SAVE" keyword in FORTRAN? Thanks. > It is more or less the same ( C's static keyword can be use while declaring variables at the source file level also. i am not sure whether F77 compilers support that.) There are some gotchas to watch out for. Certain Fortran 77 compilers assume local variables to be static by default. At least in one instance ( an interpreter ), a translator had strange behaviour in which states were saved between the function calls with out my intention to do so. ( i initialized a local variable with 0 ) static keyword in C when used at the global scope (module scope ) has got a different meaning . It is a question of visibility. why cannot u take a look at F2C (or it's parser ) ? Praseed Pai www.praseedpai.com codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |