Quote:
strcpy ( c, &c[6] ) ;
In the above line you are
misusing strcpy
.
From the
documentation[
^]:
To avoid overflows, the size of the array pointed by destination shall be long enough to contain the same C string as source (including the terminating null character), and should not overlap in memory with source.
Overlapping destination with source is just what you are doing.
Please note, your code is an odd mix of
C
and
C++
. Having at your disposal the
C++
compiler, you might simply write:
#include <iostream>
int main ()
{
const char * p = "http://localhost:4000/index.html";
std::cout << (p+6) << "\n";
}