title: Compiler error: invalid conversion from 'int' to 'int*' [-fpermissive]|
body: <p>I got a compiler error:</p>
  
  <blockquote>
    <p>main.cpp|59|error: invalid conversion from 'int' to 'int*' [-fpermissive]|</p>
  </blockquote>
  
  <p>The offending line is</p>
  
  <pre><code>int *pComienzo = vector, *pFinal = vector[nElementos-1];
  </code></pre>
  
  <p>Why there is an error?  Can someone help me?</p>
  
  <p>Below is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;ctype.h&gt;
  
  using namespace std;
  const unsigned short int MAX_VAL = 10;
  
  int LongitudCadena(char*);
  
  int BuscarCaracter(char *cadena, char caracter);
  
  void Ordenar(int *vector, int nElementos, bool ascendente);
  
  int main()
  {
      char *cadena = "asdasd";
  
      cout &lt;&lt; LongitudCadena(cadena) &lt;&lt; endl;
  
      cout &lt;&lt; BuscarCaracter(cadena, 'a') &lt;&lt; endl;
  
      int iArray[] = {5,4,3,2,1};
  
      Ordenar(iArray, 5, 1);
  
      cout &lt;&lt; iArray &lt;&lt; endl;
  
      return 0;
  }
  
  int LongitudCadena(char *cadena)
  {
      char *c = cadena;
      for(int i = 0; i &lt; MAX_VAL; i++)
      {
          if (c[i] == 0) break;
          cadena++;
      }
  
      return  cadena - c;
  }
  
  int BuscarCaracter(char * cadena, char caracter)
  {
      char *pCadena = cadena;
      for (int i = 0; i &lt; MAX_VAL; i++)
      {
          pCadena++;
          if (toupper(cadena[i]) == toupper(caracter))
          return pCadena- cadena;
      }
  
      return -1;
  }
  
  void Ordenar(int *vector, int nElementos, bool ascendente)
  {
  
  
      int *pComienzo = vector, *pFinal = vector[nElementos-1];
  
      if (ascendente)
      {
          for (int i = 0; i &lt; nElementos; i++)
          {
              for (; pComienzo &lt; pFinal; pComienzo++, pFinal--)
              {
                  if (*pComienzo &gt; *pFinal)
                  {
                      *pComienzo += *pFinal;
                      *pFinal -= *pComienzo;
                      *pComienzo -= *pFinal;
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I'm learning...</p>