Write a program that simulates a lottery
There's quite a few things I would change here. Getting quality random number generation right is difficult, (these questions come up a lot so it's something I've blogged about), but thankfully with the newer c++11 standard things are a fair bit easier.
Program Correctness
Making sure that your program is correct is extremely important. As it stands this program is not correct (as in does not meet the specification):
cout &lt;&lt; &quot; \nThere are &quot; &lt;&lt; count &lt;&lt; &quot; matching elements &quot;;
for(int i=0; i&lt;size; i++){
    if(winningDigits[i]==player[i]){
        cout &lt;&lt; i+1 &lt;&lt; &quot; &quot;;
    }
}
cout &lt;&lt; &quot;\n&quot;;

This comparison assumes that the arrays are sorted, which is not the case. So matching elements could be completely missed here. Sort the arrays first before comparing them or consider a different data structure to store the results from generating the numbers.
Basic things:
There's commented out code in the source, this is almost always a bad sign. Keep code changes tracked by version control, not commented out blocks.
Loops like this are a nightmare formatting wise:
for(int i=0; i&lt;size; i++)
cout &lt;&lt; winningDigits[i] &lt;&lt; &quot; &quot;;

I personally always use braces (as does the coding standard we go by at my work) but whatever you do you need a tab here:
for(int i=0; i&lt;size; i++){
    cout &lt;&lt; winningDigits[i] &lt;&lt; &quot; &quot;;
}

Another thing is this:
using namespace std;

Other people have commented on this, but generally speaking the only time you would really want to do this is when you are making some small throwaway program for testing a concept or making an example or similar. You probably don't want to do it in any production code. This pollutes the namespace which is something you don't want, see this https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice for more info on that.
If you want to cut down on on typing you can bring in just the names you need by doing:
using std::cout;
using std::cin;

an so on.
Standard library containers
Generally speaking with c++ you don't want to use raw arrays, the standard container classes are safer and allow you to be more productive. There's a c++ FAQ article that deals with just this, so give that a read.
int winningDigits[size];
int player[size];

Instead of these I would use std::array for both of these as the length is both fixed and known at compile time. Were then lengths not known then std::vector would most likely be the best choice. These become:
#include &lt;array&gt; //header needed for std::array

std::array&lt;int, size&gt; winningDigits;
std::array&lt;int, size&gt; player;

Now this ends up being the same type in a bunch of different places so a typedef will help make things easier:
typedef std::array&lt;int, size&gt; lottery_results_t;
lottery_results_t winningDigits;
lottery_results_t player;

An additional benefit of the typedef is that if you do change the type later it will be easier to do so.
Random number generation
rand() is a really bad random number generator, to the point where the standard committee actually made a report about depreciating it. Additionally rand() gets worse when you take the modulus of it (statistically speaking).
We can avoid all these problems by just using the newer c++ random number library in a manner like this:
std::default_random_engine generator;
generator.seed( time(0) );
std::uniform_int_distribution&lt;int&gt; distribution(0,9);//note the min and max parameters are inclusive here
while(true)
{
    std::cout &lt;&lt; distribution(generator) &lt;&lt; std::endl;
}

Demonstration here: http://ideone.com/xzgcZy
The output code definitely violates the &quot;don't repeat yourself&quot; principle. Success200 has posted a great answer that outlines some of the things you can do to reduce that duplication.