Deleting duplicates from a string
C++ is C++

A lot of this code is basically C. So let's C++ify it. &lt;cstdio&gt; is the C-style IO library. In C++, we have &lt;iostream&gt;, with cout. The biggie here is:

char message[500] = "The dog jumped up and down and ate chocolate, then he bit the cat";


C++ has a library for dealing with strings. It's called &lt;string&gt;, and is very useful:

std::string message = "The dog ...";


std::string manages its own memory and comes with a whole bunch of member functions. One of those is size():

size_t msg_length = message.size();
std::cout &lt;&lt; message &lt;&lt; '\n';
std::cout &lt;&lt; "The message length before deleting the dupes is: "
          &lt;&lt; msg_length &lt;&lt; "\n\n";


Although if you want to stick with pointers, you still wouldn't need to write your own length function as there is strlen. But if you really insist on writing your own loop, please put the thing you're comparing on the left-hand side:

for (; array[i] != 0; ++i) ;


Or, since we're comparing against 0:

for (; array[i]; ++i) ;


Putting constants on the left-hand side is, frankly, terrible.

deleteDupes

The C++ standard library comes with a whole bunch of algorithms. The algorithms tend to be very useful, both in terms of code readability, performance, and correctness. For one thing, your loop has a bug (you have --i which presumably should be --j).

I would use the Erase-Remove idiom. That is:

void deleteDupes(std::string&amp; message) {
    message.erase(
        std::remove_if(message.begin(), message.end(), ???),
        message.end()
        );
}


What do we put in the ???s? We need a predicate that will return true if this is a character we've seen before. Easy way of keeping track of that is an std::unordered_set and thanks to C++11, we can stick the predicate in-line:

void deleteDupes(std::string&amp; message) {
    std::unordered_set&lt;char&gt; seen;
    message.erase(
        std::remove_if(message.begin(), message.end(), [&amp;](char c){
            return !seen.insert(c).second;
        })
        message.end()
        );
}


Basically, insert will tell you if it succeeded or not (i.e. this is the first time you've seen c or not). If it's the first time, we return false (and insert into our set). Otherwise, we return true and the remove_if algorithm marks this character for deletion. We then erase all the dupes in one go. 

Simple. Correct. Readable.