title: How can I read a file and determine its data representation as I pass it into a linked list?
body: <p>So in this code I'm trying to take a text file, grab all of string tokens and make nodes that are added into a linked list. I'm able to grab every individual string token from this, and make a node with the 'data' field filled in correctly. The problem comes when I try and use the determinedohf function to fill in the 'type' field. I know in this code there is only one check for octal but even before then my gcc compiler is telling me there are incorrect casts to pointers/char that I'm not understanding. 
  What am I missing or not doing correctly in my determinedohf function? I feel like parameters and such may also be incorrect, but I'm not sure how...</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  typedef struct node {
  
      char *data;
      char *type;
      struct node *next;
  
  } node;
  
  
  void readfile(char* filename) {
  
      FILE *file = fopen(filename, "r");
  
      if(file == NULL) {
          exit(1);
      }
  
      char buffer[51];
  
      while(fscanf(file, "%s", buffer) != EOF) {
  
          add(buffer);
      }
  
      fclose(file);
  }
  
  void add(char* line) {
  
      node *temp = malloc(sizeof(node));
      temp-&gt;data = strdup(line);
      temp-&gt;type = determine(line);
      temp-&gt;next = NULL;
      current = start;
  
      if(start == NULL) {
          start = temp;
      } else {
          while(current-&gt;next != NULL) {
              current = current-&gt;next;
          }
          current-&gt;next = temp;
      }
  }
  
  char* determineDOHF(node* line){
  
        /*supposed to determine whether the string is represented as
        decimal, octal, hex, or floating point*/
      char *dohfType;
      char input[51] = line;
      if(input[0] == '0'){
          dohfType = 'Octal';
      }
  
      return dohfType;
  
  }
  </code></pre>