fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. return 0;
  6. }
  7.  
  8. int getNodeCount(struct node *list) {
  9. struct node *temp = list;
  10. int count = 0;
  11.  
  12. if (list == NULL) {
  13. return 0;
  14. }
  15. while ( temp != NULL) {
  16. count++;
  17. temp = temp->next;
  18. }
  19. return count;
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:8:25: warning: ‘struct node’ declared inside parameter list will not be visible outside of this definition or declaration
 int getNodeCount(struct node *list) {
                         ^~~~
prog.c: In function ‘getNodeCount’:
prog.c:17:19: error: dereferencing pointer to incomplete type ‘struct node’
        temp = temp->next;
                   ^~
stdout
Standard output is empty