My best guess is that you are confused by the similarity of the variable name in main b1, and the parameter name in the function b. Those names are completely unrelated, and could be called anything you like.
In the main function, b1 is a local variable that is declared as type struct book, and then initialized with a compile time constant initializer. The name b1 is arbitrary and can be any valid identifier.
In the display function, b is an argument to the function of type struct book. When the function is called, the caller must provide a struct book, and that struct will be copied into b. It's important to understand that b is a copy of the struct that was passed to the display function, which means that any changes that b makes to its local copy will not be propagated to the original structure declared in main.
Here's an attempt to demonstrate these principles in code
#include <stdio.h>
struct book
{
char name[25] ;
char author[25] ;
int callno ;
};
void display( struct book someArbitraryNameForTheLocalCopyOfTheStructThatThisFunctionUses )
{
printf ( "%s ", someArbitraryNameForTheLocalCopyOfTheStructThatThisFunctionUses.name );
printf ( "%s ", someArbitraryNameForTheLocalCopyOfTheStructThatThisFunctionUses.author );
printf ( "%d\n", someArbitraryNameForTheLocalCopyOfTheStructThatThisFunctionUses.callno );
// the following line has no effect on the variable in main since
// all we have here is a local copy of the structure
someArbitraryNameForTheLocalCopyOfTheStructThatThisFunctionUses.callno = 5555;
}
int main()
{
struct book someLocalVariable = { "Let us C", "YPK", 101 };
// the following line will make a copy of the struct for the 'display' function
display( someLocalVariable );
// the following line will still print 101, since the 'display' function only changed the copy
printf ( "%d\n", someLocalVariable.callno );
struct book anotherBook = { "Destiny", "user3386109", 42 };
// any variable of type 'struct book' can be passed to the display function
display( anotherBook );
return 0;
}
void display (int i) { ... }?struct book b1 ;calling the function ?bis a value-parameter automatic variable indisplay(), copied fromb1inmain()when the call is performed. It really is that simple. What about that don't you understand? (and possibly related to your question, the warnings you (better) be getting aboutdisplay()not being declared before use and having an assumedintreturn value, and not matching that implicit declaration when you finally encounter it, can be fixed by either properly prototypingdisplayor by moving its definition abovemain()).