cacheMem is my 2 dimen array of ints
valdbit is a 1 dimen array of ints
this is my code tthes are my errors using .net Academic
line 57 being the statement inside the for loop
i have no idea what im doing wrong here im new to C but have been programming C++ for a while. i just can't see my error
valdbit is a 1 dimen array of ints
Code:
int main(int argc, char *argv[], int blockSizeInWords, int numberOfSets, int blocksPerSet)
{
int i;
int j;
int *cacheMem = (int *)malloc(numberOfSets * sizeof(int));
for(i = 0; i < (blocksPerSet * blockSizeInWords); i++)
{
cacheMem[i] = (int *)malloc(blocksPerSet * blockSizeInWords * sizeof(int));
}
int *validBit = (int *)malloc(numberOfSets * blocksPerSet * blockSizeInWords * sizeof(int));
char line[MAXLINELENGTH];
stateType state; /* Defined Globally */
FILE *filePtr;
this is my code tthes are my errors using .net Academic
Code:
e:\EECS370\Cache Simulator\simulate.c(57): warning C4047: '=' : 'int' differs in levels of indirection from 'int *'
e:\EECS370\Cache Simulator\simulate.c(61): error C2143: syntax error : missing ';' before 'type'
e:\EECS370\Cache Simulator\simulate.c(63): error C2143: syntax error : missing ';' before 'type'
e:\EECS370\Cache Simulator\simulate.c(64): error C2275: 'stateType' : illegal use of this type as an expression
e:\EECS370\Cache Simulator\simulate.c(64): error C2146: syntax error : missing ';' before identifier 'state'
e:\EECS370\Cache Simulator\simulate.c(64): error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
line 57 being the statement inside the for loop
i have no idea what im doing wrong here im new to C but have been programming C++ for a while. i just can't see my error