K
KOFKS
code like that:
#include <stdlib.h>
#define decPtr(type, name) do { (type) * (name) = malloc(sizeof
(type) ); } while (0);
typedef struct pt
{
int x;
int y;
} pt;
int main( int argc, char *argv[])
{
decPtr(pt, pt0);
return 0;
}
The compiler complains:
pt0 is an identifier has not been declared$B!J(Bsomething means this, I
interprete it from native language other than English$B!K(B
Is my implementation wrong, or this method does not work through?
Anyone help? Thanks a lot~
#include <stdlib.h>
#define decPtr(type, name) do { (type) * (name) = malloc(sizeof
(type) ); } while (0);
typedef struct pt
{
int x;
int y;
} pt;
int main( int argc, char *argv[])
{
decPtr(pt, pt0);
return 0;
}
The compiler complains:
pt0 is an identifier has not been declared$B!J(Bsomething means this, I
interprete it from native language other than English$B!K(B
Is my implementation wrong, or this method does not work through?
Anyone help? Thanks a lot~