Finding string duplicates
A function does one thing, and one thing only.

Break your findrepeats() function apart. As the name indicates, only search for repeats, nothing else. Especially no output. When you are done, return asciiArray.

Maintain a clear separation of input and output, and the actual logic.

Keeping your functions short increases readability a lot, it also makes testing for bugs and restructuring your program later on a lot easier. In addition to that, it also reduces the number of local variables in a function, which aids further with readability.



int asciiArray[256];
for (int i = 0; i &lt; 256; i++) // creates my refference array for the comparison and sets all the values equal to zero
    asciiArray[i] = 0;


Write it shorter:

int asciiArray[256] = {0};


Or use at least a builtin:

int asciiArray[256];
memset(asciiArray, 0, 256);


See also Array intialization



As mentioned in the other answer, don't try to iterate over the input string twice. You don't need to. asciiArray is all you need to generate the output, as long as the order doesn't matter.



vector &lt;char&gt; alreadyprintedcharacters;


Never use global variables. Just don't. That is bound to have side effects sooner or later.

Try e.g. calling findrepeats() twice now. The second call will not work as expected, as it is still (wrongly) using the exemption list from the first run.

This variable is only used inside findrepeats(), so put it in the local scope where it belongs.



int asciiArray[256];
char ch;

ch = in[i];
charconv = static_cast&lt;int&gt;(ch);
asciiArray[charconv]++;


Something is horribly wrong here, can you guess what?

Try to remember what char actually is. 256 distinct values, but was it 0..255 or was it rather -128..127?

You don't remember?
That's right. It's not defined what the default interpretation for a standalone char is, that depends on your compiler.

char alone is perfectly safe to transfer input to output, as signed or unsigned doesn't matter for that.

But if you want to use it as an array index, you must explicitly state that you want an unsigned char, or your program will crash horribly if the input contains anything outside the ASCII range (0..127), as it may be interpreted as a negative value.

Your compiler probably refused to accept char as an array index, and this problem is exactly the reason why. static_cast&lt;int&gt;(ch) only broke the type check, but your application will still crash.