How to include??

BCS ao at pathlink.com
Wed Oct 17 21:59:39 PDT 2007


Reply to KAR,

> Hello all, im a c programmer for years, and recently and recently
> trying to switch for better language since my projects becoming biger
> and bigger, now i need faster language in terms of development but i
> never fan of c++, D looks promising but starting up can be frustating
> since not much in tutorial provided.
> 
> Can somebody tell me of source code filing structure, since ive been
> use #include and stuff for long, and not familiar with d module and
> import...
> 

import fulfills the same purpose as #include. But rather than have a .h file 
that defines thing and a .c file that implements them, you only have one 
file that both defines and implements things. The import statement does it 
all for you. When the compiler finds an import, it does some of the compiling 
of the imported file, enough that it can get the list of function, classes, 
structs, enums etc. that are defined. These are added to the list of available 
symbols much like prototypes in a .h file do.

Hopefully that will answer your question. If not, ask some more.




More information about the Digitalmars-d-learn mailing list