/******************************************************************************
Inserting At the beginning of a structure in C
Consider the following structrure
struct participant{
int pno;
char pname[30];
char pemail[30];
char regno[10];
char phone[11]
} P[MAX];
I want to insert values at the beginning of the P array.
*******************************************************************************/
#include <stdio.h>
#include <string.h>
#define MAX 10
struct participant{
int pno;
char pname[30];
char pemail[30];
char regno[10];
char phone[11];
} P[MAX];
int main()
{
//beginning of array is P[0]
//so code goes below
P[0].pno=1234;
strcpy(P[0].pname,"namespace");
strcpy(P[0].pemail,"
[email protected]");
strcpy(P[0].regno,"regno:1234");
strcpy(P[0].phone,"+1 030214554632");
printf("Hello World");
return 0;
}