Mail Archives: djgpp/1998/04/16/13:46:40
... What i meant was how i should
>program structures like units in c++, what the equivalent of a unit is in
>c++, and how i should use it.
>
I think a pascal-unit is the same as a c++ -library or an -object-file.
I changed from pascal to c, and what were units in pascal now
are other c-programs as well.
for example: i had a program "test.pas", which used the unit
"mouse.tpu". (from which i had the source code "mouse.pas")
now i have "test.c", which needs the object file "mouse.o" (
which is generated from "mouse.c"). And i coud make a library
"mouse.a" from mouse.o if i wanted to.
To use a .c file like a unit, you need to declare all functions and
variables in a separate header file (example: "mouse.h") and include
this in your program ("test.c"), as you include the "uses ..." in
pascal.
hope this is of any help,
Elias Pschernig
- Raw text -