function param pointer to struct prototype in c
#include <stdio.h>
#include <stdlib.h>
struct person {
char name[50];
int age;
};
void displayPersonInfo(struct person *p);
- Include necessary libraries to use standard input-output functions and memory allocation functions.
- Define a structure called "person" with two members: a character array for the name and an integer for the age.
- Declare a function called "displayPersonInfo" that takes a pointer to a struct person as a parameter.