Find a substring with minimum distance
There are already the functions std::min and std::max that you should use. It either takes 2 elements or an std::initializer_list, so you could use

int min_1 = std::min({first_char, second_char, third_char});


There is also std::minmax to get both the minimum and the maximum, possibly more efficiently than calling std::min and then std::max. Not that it matters for your application, but it is a good habit to get into.

There is also std::none_of to check if none of first_char, second_char and third_char are -1, but the use is awkward because it needs a predicate.
Use range based for when possible. In this case you iterate over all the chars in the string, so it is easy:

//while (*pstring != '\0')
//for (const char c : string1)
for (const char c : "adobecodebanc")

If you initialize first_char, second_char and third_char with std::numeric_limits&lt;int&gt;::min() you could leave out the check if all of them are not -1. You need to be careful for when printing though.
I assume this is supposed to be a general function for any string. If that string is "erf" the function prints "e". That doesn't seem right.
main(void) is considered bad style in C++. In C a function void f(); takes any number of arguments, so f(234, 2) compiles fine. To make that fail to compile you have to write void f(void). In C++ f(234, 2) doesn't compile and void f(void) is redundant, making you look like a C programmer trying out C++.
final_distance is initiated to "some big number". It makes sense to use std::numeric_limits&lt;int&gt;::max() instead of 1000.
Use const when it makes sense, for example for min_1, max_1 and distance.
Putting it all together it looks like this:

#include &lt;iostream&gt;
#include &lt;stdio.h&gt;
#include &lt;algorithm&gt;

int main()
{
    char string1[] = "adobecodebanc";
    int first_char = -1;
    int second_char = -1;
    int third_char = -1;
    int final_distance = std::numeric_limits&lt;int&gt;::max();
    int final_min = 0;
    int final_max = 0;
    int counter = -1;

    /* iteratre over the string and compare each characeter*/
    for (const char c : string1)
    {
        counter++;
        /* if any character matches substring condition
           assign index value of the string to that variable  */
        if (c == 'a')
        {
            first_char = counter;
        }
        else if (c == 'b')
        {
            second_char = counter;
        }
        else if (c == 'c')
        {
            third_char = counter;
        }
        else{
            continue;
        }

        if (first_char != -1 &amp;&amp; second_char != -1 &amp;&amp; third_char != -1)
        {
            /* get the min and max index value difference*/
            const auto minmax = std::minmax({first_char, second_char, third_char});
            const int distance = minmax.second - minmax.first;

            /*track the minimum substring so far*/
            if (distance &lt; final_distance)
            {
                final_distance = distance;
                final_min = minmax.first;
                final_max = minmax.second;
            }
        }
    }

    int temp = final_min;

    while (final_max &gt;= temp)
    {
        std::cout &lt;&lt; string1[temp];
        temp++;
    }
    std::cout &lt;&lt; std::endl; //should not be needed since the program exits
    return 0; //gets implicitly added if you leave it out
}


I feel like I'm missing an obvious improvement, so I'll take a look again later.