07/02/08 00:20:11
>>348
今Borland C++ 5.5.1をダウンロードして試してみましたが全く
エラーになりません。
<struct.h>
typedef struct test_st
{ int a;
int b; }TEST_ST;
<main.c>
#include"struct.h"
void testFunc(void);
int main(void)
{testFunc();
return 0; }
<sub.c>
#include<stdio.h>
#include"struct.h"
void testFunc()
{ printf("Hello\n"); }
main.cとsub.cで2回構造体の定義(struct.h)をインクルード
していますがエラーにならずに実行できます。
ちなみにエラーになったのはVC++でC++を使ったときでした。
これはエラーにならないコンパイラが甘いということでしょうか?