in c header file,Why I don’t have to include the define of some types I made,I can use it directly in header as long as I include the def in c file ? because that’s impossible in c++ I think,for example:
define.h
typedef int _int32;
object.h
_int32 num;
void init();
object.c
#include define.h
void init()
{
num = 12;
}
You can’t. Either your compiler is wrong, or you are (I bet on the latter). Post your entire code.
My guess is that you either:
included
object.hindefine.hincluded some other file that has a declaration of
numyou’re not compiling your source code
Anyway, until you post your actual code we can’t tell for sure.
EDIT:
If your problem is that you can use
_int32without the include, bear in mind that_int32can be a basic type on some platforms. But in your example, you’re usingnum, which is impossible.