title: Can't read file into char array (some pointers issue, like always)
body: <p>Yes, I have this kind of problems because it was always hard for me to follow the pointers operations. So, I have this simple code:</p>
  
  <pre><code>struct myfile {
      char* name;
      char* content;
      long size;
  };
  
  myfile this_file;
  
  int main() {
      read();
      return 0;
  }
  
  void read() {
      output("Please, specify file name: ");
      cin &gt;&gt; (this_file.name = new char);
      FILE *stream;
      stream = fopen(code.name, "r");
      if (stream != NULL) {
          fseek(stream , 0, SEEK_END);
          myfile.size = ftell(codefile);
          myfile.content = new char[myfile.size];
          fseek(myfile, 0, SEEK_SET);
          if ((fread(myfile.content, 1, myfile.size, stream)) == 0) {
              fclose(codefile);
              cout &lt;&lt; "File is empty!\n");
          }
      }
   }
  </code></pre>
  
  <p>It gets the name of the file correctly, it gets the size of the content but when trying to allocate space to the <code>content</code> member the program crashes, which I know is some pointers issue, but, as always, can't remember/figure out what is it. It crashes when reaching this line: <code>myfile.content = new char[myfile.size];</code></p>
  
  <p>I need your help again. Thanks!</p>