Hello everyone the following code doesn't execute properly
( After the second entry the program comes out)!!
Code:
#include<stdio.h>
void linkfloat();
int main(){
struct book {
char name;
float price;
int page;
};
struct book b[3];
int i;
for(i=0;i<3;i++){
printf("\nEnter name ,price and pages: ");
scanf("%c%f%d",&b[i].name,&b[i].price,&b[i].page);//seems some thing is wrong here
}
printf("\n");
for(i=0;i<3;i++){
printf("%c%f%d\n",b[i].name,b[i].price,b[i].page);
}
return 0;
}
void linkfloat(){
float a=0,*b;
b=&a;
a=*b;
}