title: C - Check if last character of a string equals "#"
body: <p>I want to check if the last character of my string is equal to a "#", and delete it if it is. However, I am unable to do a comparison. What is wrong with my code?</p>
  
  <pre><code>char* involved_node_string(int shared_val, int values[], int directions[]){;
      char involved_nodes[1024] = {};
      char *p = involved_nodes; 
      char result[1024];
      int k;
      for (k = 0; k &lt; 4; k++){
          if (values[k] == shared_val){
              sprintf(result, "%d", directions[k]);
              strcat(involved_nodes, result);
              strcat(involved_nodes, "#");                                
          }
      }
      char v = p[strlen(p)-1];
      if (v == "#"){
          printf("Yes\n");    
      }
  
  
      return p;
  }
  </code></pre>