home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 3
/
AACD03.BIN
/
AACD
/
Programming
/
sofa
/
archive
/
SmallEiffel.lha
/
SmallEiffel
/
lib_show
/
cecil
/
example1
/
example.e
< prev
next >
Wrap
Text File
|
1999-06-05
|
841b
|
40 lines
class EXAMPLE
--
-- The Eiffel program is running first, create an empty STRING
-- which is passed to the C world.
-- The C program then modify the Eiffel STRING calling the Eiffel
-- feature `extend' of class STRING.
-- Finally, the modified STRING is printed.
--
-- To compile this example, use command :
--
-- compile -cecil cecil.se example c_prog.c
--
-- Is is also possible to do :
--
-- gcc -c c_prog.o
-- compile -cecil cecil.se example c_prog.o
--
creation make
feature
make is
local
string: STRING;
do
!!string.make(0);
call_c_prog(string);
io.put_string(string);
end;
feature {NONE}
call_c_prog(str: STRING) is
external "C_WithoutCurrent"
alias "c_prog"
end;
end -- EXAMPLE