title: How to use a char buffer array as the case in switch-case C++?
body: <p>I have a snip of the following code which should read the first 4 objects in a .wav file in order to eventually parse the header of the file. I know I'm doing something wrong here because the buffer always passes &quot;RIFF&quot; without printing out  <code>Riff is found</code></p>
  <p>How should I use the Switch-case in order to find the correct array characters?</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main()
  {
      
      cout &lt;&lt; &quot;Nom: &quot;;
      string filename;
      cout &lt;&lt; &quot;First Input filename:&quot; &lt;&lt; endl;
      cin &gt;&gt; filename;
  #pragma warning (disable : 4996)
      FILE* InFile = fopen(filename.c_str(), &quot;rb&quot;);        // Open wave file in read mode
  
        char Buffer[4];
      while (InFile) {
          fread(Buffer, sizeof Buffer[0], 4, InFile);
          switch (Buffer[4]) {
          case 'R' +'I'+'F'+'F':
              cout &lt;&lt; &quot;Riff is found &quot; &lt;&lt; endl;
  
          case 'c' +'r'+ 'i'+ 'f' :
              cout &lt;&lt; &quot;CRiff is found &quot; &lt;&lt; endl;
          }
      }
  }
  </code></pre>