// "cfa -c -o vector_test.o vector_test.c" // "cfa -CFA vector_test.c > vector_test_out.c" // "cfa -E vector_test.c > vector_test_out.c" // "gcc31 -c vector_test_out.c -o vector_test.o" #include "fstream.h" #include "vector_int.h" #include "array.h" extern "C" { int printf( const char *, ... ); } int main() { ofstream *sout = ofstream_stdout(); ifstream *sin = ifstream_stdin(); vector_int vec = vector_int_allocate(); int nombre; for(;;) { sin >> &nombre; if( fail( sin ) || eof( sin ) ) break; append( &vec, nombre ); } sout << "Array elements: "; write_all( get_begin( vec ), get_end( vec ), sout ); /// int index; /// for( index = 0; index <= array_last( vec ); ++index ) { /// sout << vec[ index ] << " "; /// } sout << "\n"; return 0; }