hi i am new to c/c++
i am making a program for a project in class
i have only started the program it still has no content, only structures however when i compiled and run it in C
the first printf wont display in the .exe
there are no errors
here is the code:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
typedef double mNum[10];
typedef int *mDim;
//structure for dimension
typedef struct{
mNum **pX;//declares double pointer for matrix
mDim m,n; //variable size of matrix
}structDimension;
//structure for run-time initialization of matrix
mNum *initializeMatrix(structDimension n){
mNum **temp;
int ctr;
for(ctr=0 ; ctr<n ; ctr++)
{
temp[ctr]=malloc(sizeof(int)*n);
}
return temp[ctr];
}
int main (int args, char *argv[]){
structDimension *pX, m, n;
int ctr; //counter - initializing memory location
int ctrrow, ctrcol;//counter for clearing matrix and displaying values
int ans;
m=1;
n=1;
for(ctrrow=0 ; ctrrow<m ; ctrrow++){
for(ctrcol=0 ; ctrcol<n ; ctrcol++){
pX[ctrrow][ctrcol] = 0;
}
}
printf("\n\nGood Day!\n\n");
getch ();
free(pX);
}
i tried compiling it in .cpp and i got these errors:
....cpp: In function `double (* initializeMatrix(structDimension))[10]':
....cpp:18: error: no match for 'operator<' in 'ctr < n'
....cpp:20: error: no match for 'operator*' in '4u * n'
....cpp: In function `int main(int, char**)':
....cpp:32: error: no match for 'operator=' in 'm = 1'
....cpp:9: note: candidates are: structDimension& structDimension::operator=(const structDimension&)
....cpp:33: error: no match for 'operator=' in 'n = 1'
....cpp:9: note: candidates are: structDimension& structDimension::operator=(const structDimension&)
....cpp:34: error: no match for 'operator<' in 'ctrrow < m'
....cpp:35: error: no match for 'operator<' in 'ctrcol < n'
....cpp:36: error: no match for 'operator[]' in '*((+(((unsigned int)ctrrow) * 12u)) + pX)[ctrcol]'
i am using bloodshed, and the automatic file extension is always .cpp and whenever i have problems using C, i save it in .cpp and it would work. however this is the first time i encountered problems with "no match for operator"
PLEASE HELP