関数へのポインタを使用してこのプログラムを作成しましたが、エラーが発生するのは
Lvalue required in function main
なぜですか?
#include<stdio.h>
fun();
main()
{
int fun();
int *ptr();
ptr=fun; //this line gives error
*ptr();
}
int fun()
{
printf("amol singh");
return 0;
}
関数へのポインタを使用してこのプログラムを作成しましたが、エラーが発生するのは
Lvalue required in function main
なぜですか?
#include<stdio.h>
fun();
main()
{
int fun();
int *ptr();
ptr=fun; //this line gives error
*ptr();
}
int fun()
{
printf("amol singh");
return 0;
}