Hi all
does any one know if it's correct to use a Static int and then return it as an int?
for example
int IncJobCount()
{
static int job_count=0;
job_count=job_count++;
return job_count;
} thanx alot:D
Printable View
Hi all
does any one know if it's correct to use a Static int and then return it as an int?
for example
int IncJobCount()
{
static int job_count=0;
job_count=job_count++;
return job_count;
} thanx alot:D
To start at 0, all you need is
static int job_count=0;
return job_count++;
To start at 1
static int job_count=0;
return ++job_count;