[問題] typedef問題
typedef float GLfloat;==>gl.h
程式中宣告
GLfloat f=0.0f出現error C2275: 'GLfloat' : illegal use of this type as an expression
可是直接宣告
float f=0.0f; 出現 error C2143: syntax error : missing ';' before 'type'
// C2275.cpp 的錯誤原因
typedef struct S
{
int mem;
} *S_t;
void func1( int *parm );
void func2()
{
func1( &S_t->mem ); // C2275, S_t is a typedef
}
可是float 不是個struct這到底要怎宣才對?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.117.1.229
→
05/26 00:22, , 1F
05/26 00:22, 1F
→
05/26 00:47, , 2F
05/26 00:47, 2F
→
05/26 00:47, , 3F
05/26 00:47, 3F
→
05/26 00:48, , 4F
05/26 00:48, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章