Your lucky that code works at all

snip-----------
char v[] = {0};
cout << "Enter a string: ";
cin >> v;
unsigned slen, len = strlen(v);
unsigned c = 1;
-------------------

you make the string 1 byte long. When the user enters text it is goin to overflow that buffer, suprising it hasent crashed yet.
What is an unsigned?
i think you mean unsigned int