C/linkfloat()
Expert: Narendra - 6/28/2006
Question
hello narendra
I regularly read the questions asked by anyone The same ques which ravi has asked about the need of linkfloat(). also i m unable to understand the need of this function.
main()
{
struct book
{
char name;
float price;
int pages;
};
struct book b[3];
int i;
for(i=0;i<=2;i++)
{
printf("enter name price and pages");
scanf("%c %f %d",&b[i].name,&bi].price,
&b[i].pages);
}
for(i=0;i<=2;i++)
printf("%c%f%d",b[i].name,b[i].price,
b[i].pages);
}
void linkfloat()
{
float a=0,*b;
b=&a;
a=*b;
}
please make it clear why this function linkfloat()is used ?and where its prototype is stored?
thank you
monika
AnswerIn this program, linkfloat() is not used anywhere.
I don't know where he intends to use it.
And that function, doesn't do much.
It is not getting any parameters from outside, nor it is sending any return value and also it is not making use of any global variables.
So, I don't see any use for this function.
He is declaring a pointer b and giving the address of a to it.
So, if he changes *b or a, both will have the same effect.
> and where its prototype is stored?
Which prototype?
Prototype of linkfloat()?
It should be declared before main() function.