fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4. struct queue{
  5.  
  6. struct data *top,*rear;
  7. };
  8.  
  9. int main()
  10. {
  11.  
  12. struct queue q;
  13.  
  14. q.top = (struct queue)malloc(sizeof(struct queue));
  15. if(q.top == NULL){printf("メモりが確保できませんでした。\n"); return 1; }
  16. q.top->key = 'a';
  17. q.top->next = NULL;
  18. q.rear = q.top;
  19.  
  20. q.top->next = (struct queue)malloc(sizeof(struct queue));
  21. if(q.top->next == NULL){printf("メモりが確保できませんでした。\n"); return 1; }
  22. q.top->next->key = 'b';
  23. q.top->next->next = NULL;
  24. q.rear = q.top->next;
  25.  
  26. q.top->next->next = (struct queue)malloc(sizeof(struct queue));
  27. if(q.top->next->next == NULL){printf("メモりが確保できませんでした。\n"); return 1; }
  28. q.top->next->next->key = 'c';
  29. q.top->next->ext->next = NULL;
  30. q.rear = q.top->next->next;
  31.  
  32.  
  33.  
  34. printf("%c\n", q.top->key);
  35. printf("%c\n", q.top->next->key);
  36. printf("%c\n", q.rear->key);
  37.  
  38. return 0;
  39.  
  40. }
  41.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:14: error: conversion to non-scalar type requested
prog.c:16: error: dereferencing pointer to incomplete type
prog.c:17: error: dereferencing pointer to incomplete type
prog.c:20: error: dereferencing pointer to incomplete type
prog.c:20: error: conversion to non-scalar type requested
prog.c:21: error: dereferencing pointer to incomplete type
prog.c:22: error: dereferencing pointer to incomplete type
prog.c:23: error: dereferencing pointer to incomplete type
prog.c:24: error: dereferencing pointer to incomplete type
prog.c:26: error: dereferencing pointer to incomplete type
prog.c:26: error: conversion to non-scalar type requested
prog.c:27: error: dereferencing pointer to incomplete type
prog.c:28: error: dereferencing pointer to incomplete type
prog.c:29: error: dereferencing pointer to incomplete type
prog.c:30: error: dereferencing pointer to incomplete type
prog.c:34: error: dereferencing pointer to incomplete type
prog.c:35: error: dereferencing pointer to incomplete type
prog.c:36: error: dereferencing pointer to incomplete type
stdout
Standard output is empty