V
vlsidesign
Here is my a portion of my program:
#include <stdio.h>
main()
{
int fahr, celsius;
int lower, upper, step;
int fc_conv(int fahr);
... snip ...
}
So I first add the 'int fahr', which is a " ... declaration [that]
announces the properties of the variables; it consists of a type name
and a list of variables..." And then I declare the "... parameter type
and names, and the type of result that the function returns." It seems
almost like I am defining fahr twice. Now I understand that "the called
function is given the values of its arguments in temporary variables
rather than the originals." So this seeming second declaration is
really not, but probably because of this localized copy. But couldn't
it be assumed to be the same type as the previous declaration, or can
you in fact change the local copy to be a float or something? Just
wondering.
All quotes taken from "The C Programming Language by K & R, 2ndEd).
#include <stdio.h>
main()
{
int fahr, celsius;
int lower, upper, step;
int fc_conv(int fahr);
... snip ...
}
So I first add the 'int fahr', which is a " ... declaration [that]
announces the properties of the variables; it consists of a type name
and a list of variables..." And then I declare the "... parameter type
and names, and the type of result that the function returns." It seems
almost like I am defining fahr twice. Now I understand that "the called
function is given the values of its arguments in temporary variables
rather than the originals." So this seeming second declaration is
really not, but probably because of this localized copy. But couldn't
it be assumed to be the same type as the previous declaration, or can
you in fact change the local copy to be a float or something? Just
wondering.
All quotes taken from "The C Programming Language by K & R, 2ndEd).