fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. struct llnode {
  6. char *name;
  7. int points;
  8. struct llnode *next;
  9. };
  10.  
  11.  
  12.  
  13. int main(void) {
  14.  
  15.  
  16.  
  17. char szContent[2048]={'\0'};
  18. int numread =0;
  19. int c,i;
  20.  
  21. FILE *pFile = fopen("c:/test.txt","r");
  22.  
  23. if(pFile)
  24. {
  25. do{
  26. c = fgetc (pFile);
  27. szContent[numread++] = c;
  28.  
  29. } while (c != EOF && (numread < sizeof(szContent)-1));
  30.  
  31.  
  32. fclose(pFile);
  33. }
  34.  
  35.  
  36. llnode node1[20], node2[20], node3[20],node4[20],node5[20], *head;
  37. i=0;
  38. do{
  39. node1[i].name="szContent[i]";
  40. i++;
  41.  
  42. } while ( szContent[i]!='\n');
  43.  
  44. do{
  45. node2[i].name="szContent[i]";
  46.  
  47. } while (szContent[i]!='\n' );
  48.  
  49. do{
  50. node3[i].name="szContent[i]";
  51. i++;
  52.  
  53. } while (szContent[i]!='\n');
  54.  
  55.  
  56. do{
  57. node4[i].name="szContent[i]";
  58. i++;
  59.  
  60. } while (szContent[i] !='\n' );
  61.  
  62. do{
  63. node5[i].name="szContent[i]";
  64. i++;
  65.  
  66. } while (szContent[i] !='\n' );
  67.  
  68.  
  69. node1[20].next = &node2;
  70. node2[20].next = &node3;
  71. node3[20].next = &node4;
  72. node4[20].next = &node5;
  73. node5[20].next = NULL;
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. system("pause");
  87. return 0;
  88.  
  89. }
  90.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:29: warning: comparison between signed and unsigned integer expressions
prog.cpp:39: warning: deprecated conversion from string constant to ‘char*’
prog.cpp:45: warning: deprecated conversion from string constant to ‘char*’
prog.cpp:50: warning: deprecated conversion from string constant to ‘char*’
prog.cpp:57: warning: deprecated conversion from string constant to ‘char*’
prog.cpp:63: warning: deprecated conversion from string constant to ‘char*’
prog.cpp:69: error: cannot convert ‘llnode (*)[20]’ to ‘llnode*’ in assignment
prog.cpp:70: error: cannot convert ‘llnode (*)[20]’ to ‘llnode*’ in assignment
prog.cpp:71: error: cannot convert ‘llnode (*)[20]’ to ‘llnode*’ in assignment
prog.cpp:72: error: cannot convert ‘llnode (*)[20]’ to ‘llnode*’ in assignment
prog.cpp:36: warning: unused variable ‘head’
prog.cpp:86: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
stdout
Standard output is empty