N
Nindi
I cannot get the following code to compile under MSVC 2003 or 2005.
...........................................................................................
#include<stdio.h>
struct _MyStruct;
typedef struct _MyStruct MyStruct;
typedef void (*funcType)(MyStruct *);
struct _MyStruct {double x;};
void MyFunc(MyStruct *theStruct){printf(" %f ",theStruct->x);}
int main () {
MyStruct A;
A.x = 100.0;
funcType f=&MyFunc;
f(&A);
}
................................................................................
Under gcc , no problem .
...........................................................................................
#include<stdio.h>
struct _MyStruct;
typedef struct _MyStruct MyStruct;
typedef void (*funcType)(MyStruct *);
struct _MyStruct {double x;};
void MyFunc(MyStruct *theStruct){printf(" %f ",theStruct->x);}
int main () {
MyStruct A;
A.x = 100.0;
funcType f=&MyFunc;
f(&A);
}
................................................................................
Under gcc , no problem .