fork download
  1. char *massive, *f;
  2. int i=0, j=0, toggle=0, counter=0;
  3.  
  4. massive=f=(char*)malloc(10*sizeof(char));
  5.  
  6. while (toggle==0){
  7. for(i=0; i<10; i++)
  8. if(fgets(massive, sizeof(massive), stdin)==0||*massive=='\n')
  9. toggle=1;
  10.  
  11. for(j=0; j<10 ; j++)
  12. f[j+10*counter]=massive[j];
  13. f=(char*)realloc(f, (10*counter)*sizeof(char));
  14. counter++;
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:4:3: warning: data definition has no type or storage class
   massive=f=(char*)malloc(10*sizeof(char));
   ^
prog.c:4:3: warning: type defaults to 'int' in declaration of 'massive' [-Wimplicit-int]
prog.c:4:3: error: conflicting types for 'massive'
prog.c:1:9: note: previous declaration of 'massive' was here
   char *massive, *f;
         ^
prog.c:4:3: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   massive=f=(char*)malloc(10*sizeof(char));
   ^
prog.c:4:20: warning: incompatible implicit declaration of built-in function 'malloc'
   massive=f=(char*)malloc(10*sizeof(char));
                    ^
prog.c:4:11: warning: initialization makes integer from pointer without a cast
   massive=f=(char*)malloc(10*sizeof(char));
           ^
prog.c:4:3: error: initializer element is not constant
   massive=f=(char*)malloc(10*sizeof(char));
   ^
prog.c:6:3: error: expected identifier or '(' before 'while'
   while (toggle==0){
   ^
stdout
Standard output is empty