iret


 
Thread Tools Search this Thread
Top Forums Programming iret
# 1  
Old 05-01-2006
iret

Hi,
I am new to C in UNIX.
I am trying to understanding the C code someone wrote 10 years ago and hoping to get it work again.
While reading his code, I found 'iret ' variable, what does this normally mean?
looks like its integer, but why called ret?

....
int iret;
FILE *perlptr;
iret = pclose(perlptr);
....

Thanks for your help.

Last edited by whatisthis; 05-01-2006 at 11:27 AM.. Reason: why
# 2  
Old 05-01-2006
As long as you understand what the code is doing it is not really necessary to understand why the programmer choose a name for a variable. I often use variables like j or k for relatively unimportant variables. That said, I also might use iret in that particular situation. The "ret" stands for "return code". The i is because, in fortran, variables that start with i through n are automatically typed as integer. The author may (like me) be a former fortran programmer.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question