I wrote this simple code in devc++. On compiling, the computer is showing syntax error at line int P = rand(); ... while the same line, if I write in the main function gets compiled easily. Please tell me what's going on!
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct poclick
{
int P = rand();
};
int main ()
{
int num = 4; // number of cases
int nj;
}