Hello everyone I just started learning how to use pointers and I got stuck in my code. I need to write a code that modifies(corrects the uppercases and lowercases and finds out the year of every citizen) and sorts a list of citizens. For an example if the user entry is:

4 //just the number of citizens

lAna lanIc 1999

lana lanac 1999

laNa LaneC 1989

lAna lanOc 1999

the display must be :

18; Lanac, Lana 

18; Lanic, Lana 

18; Lanoc, Lana

28; Lanec, Lana 

```
#include <stdio.h>
#include <string.h>
#include <ctype.h>

typedef struct {
char name[26];
char surname[26];
int birth;
}   citizen;   //the structer for the citizen

void modify(citizen *g);
int compare(citizen g1, citizen g2); //compares citizens by birth or          surname or name 
void sort(citizen g[], int);  //insertion sort

int main()
{   
    int n, i;
    citizen g[100];

    scanf("%d", &n);

    for(i = 0; i < n; i++) {
       scanf("%s %s %d", g[i].name, g[i].surname, &g[i].birth);
       modify(g + i);
    }

    sort(g, n);

    for (i = 0; i < n; i++) {
         printf("%2d; %s %s\n", g[i].birth, g[i].surname, g[i].name);
    }

    return 0;
}

void modify(citizen *g) { //here I'm having trouble
    int i = 0; 

    //trying to correct the name
    if(isalpha(*g[i].name[0])) {   
       *g[i].name[0] = toupper(*g[i].name[0]);
     }
    for(i = 1; i < strlen(*g[i].name); i++) {
       *g[i].name = toupper(*g[i].name);
     }
    //then the surname

    if(isalpha(*g[i].surname[0])) {
        *g[i].surnma[0] = toupper(*g[i].surname[0]);
     }
     for(i = 1; i < strlen(*g[i].surname); i++) {
        *g[i].surname = toupper(*g[i].surname);

     }
     *g[i].birth = 2017 - *g[i].birth; //finding how old is the citizen

 }

int compare(citizen g1, citizen g2) {
    if(g1.birth == g2.birth) {
        if(!strcmp(g1.surname, g2.surname)) {
               return strcmp(g1.name,g2.name);
        }
        else {
              return strcmp(g1.surname, g2.surname);
        }
     }
    else if (g1.birth > g2.birth) {
              return 1;
    }
              return -1;
}

void sort(citizen g[], int n) { //insertion sort
   int i, j;
   citizen tmp;

   for(i = 0; i < n; i++) {
       tmp = g[i];
       j = i;
       while(j > 0 && compare(g[j-1], tmp)) {
            g[j] = g[j - 1];
            j--;
        }
        g[j] = tmp;

     }
 }  

```