fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(){
  4. char a; int b; int c; float d;
  5. scanf("%c" &a);
  6. scanf("%d" &b);
  7. scanf("%d" &c);
  8. scanf("%f" &d);
  9.  
  10.  
  11. struct {
  12. char nome[50];
  13. int codigoproduto;
  14. int quantidade;
  15. float preco;
  16. } produto;
  17.  
  18. produto.nome = a;
  19. produto.codigoproduto = b;
  20. produto.quantidade = c;
  21. produto.preco = d;
  22. return 0;
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:5:13: error: invalid operands to binary & (have 'char *' and 'int')
  scanf("%c" &a);
             ^
prog.c:6:13: error: invalid operands to binary & (have 'char *' and 'int')
  scanf("%d" &b);
             ^
prog.c:7:13: error: invalid operands to binary & (have 'char *' and 'int')
  scanf("%d" &c);
             ^
prog.c:8:13: error: invalid operands to binary & (have 'char *' and 'float')
  scanf("%f" &d);
             ^
prog.c:18:15: error: assignment to expression with array type
  produto.nome = a;
               ^
prog.c:16:4: warning: variable 'produto' set but not used [-Wunused-but-set-variable]
  } produto;
    ^
stdout
Standard output is empty