title: What is wrong with my code? I can't compile it
body: <p>So the objective of this program is to display the initials of a name typed in by the user. So if I type James Issac Newton, it should give me JIN. I tried compiling my code in the terminal using g++ -Wall -o name name.cpp but it wouldn't compile. What exactly am I doing wrong??     </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string&gt;
  #include&lt;stdio.h&gt;
  using namespace std;
  int main()
  {
    char name[100];
     gets(name);
     char a,b,c;
     cin&gt;&gt;name;
     a=name[0];
     int x;
     for (int i=0;i&lt;=strlen(name);i++)
         {
              if (name[i]==" ")
                    {
                       b=name[i+1];
                       x=i;
                       break;
                    }
  
         }
     for (int j=x;j&lt;=strlen(name);j++)
           {
               if (name[j]==" ")
                     {
                  c=name[j+1];
                     }
           }
  
  
          cout&lt;&lt;a&lt;&lt;b&lt;&lt;c;
  
          return 0;   
  
  
          }
  </code></pre>
  
  <p>Compiler error messages:
  The name of my file is acro.cpp acro.cpp:  </p>
  
  <pre><code>In function âint main()â:  
  acro.cpp:8:2: warning: âchar* gets(char*)â is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
  acro.cpp:8:11: warning: âchar* gets(char*)â is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] acro.cpp:13:29: error: âstrlenâ was not declared in this scope
  </code></pre>