fork(1) download
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<stdlib.h>
  4. #define tam 100
  5.  
  6. typedef struct {
  7. char *nome;
  8. char *curso;
  9. char *cota;
  10. int matricula;
  11. int coef;
  12. } TipoAluno;
  13.  
  14. int main() {
  15. TipoAluno aluno = {
  16. .nome = malloc(2),
  17. .curso = malloc(2),
  18. .cota = malloc(2),
  19. .matricula = 1
  20. };
  21. strcpy(aluno.nome, "A");
  22. strcpy(aluno.curso, "B");
  23. strcpy(aluno.cota, "C");
  24. printf("%s", aluno.nome);
  25. }
  26.  
  27. //https://pt.stackoverflow.com/q/303898/101
Success #stdin #stdout 0s 4500KB
stdin
Standard input is empty
stdout
A