Post your code - or at least the minimal amount that compiles and illustrates your issue.
Also, "if" is not a function.
ok, this is the codes,
although I satisfy the condition, count hasn't change, still zero
I don't know why..........
#include "stdafx.h"
#include "stdlib.h"
#include "time.h"
void calCount (int* ranNum, int* num1, int* count);
int _tmain(int argc, _TCHAR* argv[])
{
int ranNum;
int num1;
int count = 0;
srand(time(NULL));
ranNum = (rand()%20) + 1;
printf("%d\n", ranNum);
printf("\nGuess: ");
scanf("%d", &num1);
calCount (&ranNum, &num1, &count);
printf("count amount: %d", count);
return 0;
}
void calCount (int* ranNum, int* num1, int* count)
{
if (*ranNum != *num1)
*count++;
if (*count == 1)
printf("\nOK\n");
return;
}