Przypisanie ciągu w C

Jestem nowy w C. Przypisanie łańcucha w następującym kodzie działa:

#include<stdio.h>
int main(void){
  char str[] = "string";
  printf("%s\n",str);
}

Ale nie działa w następujący sposób, nawet podam numer indeksuname[]:

#include <stdio.h>
int main(void){
  struct student {
    char name[10];
    int  salary;
  };
  struct student a;
  a.name[10] = "Markson";
  a.salary = 100;
  printf("the name is %s\n",a.name);
  return 0;
}

Dlaczego to się dzieje?

questionAnswers(4)

yourAnswerToTheQuestion