Xref: utzoo comp.lang.c++:1916 comp.lang.fortran:1484 Path: utzoo!attcan!uunet!mcvax!hp4nl!rivm!ccea3 From: ccea3@rivm.UUCP (Adri Verhoef) Newsgroups: comp.lang.c++,comp.lang.fortran Subject: f77 and C++ w/ cin/cout: can it be done? Keywords: f77 C++ cin cout printf Message-ID: <1118@rivm05.UUCP> Date: 9 Nov 88 17:02:09 GMT Reply-To: ccea3@rivm05.UUCP (Adri Verhoef) Organization: RIVM, Bilthoven, The Netherlands Lines: 55 - I have this fortran-file "m.f": program main call hello() end - and I have this C++-file "s.c": #include void hello_() { STATEMENTS; } - I compile "m.f": $ f77 -c m.f - Then I compile "s.c", and execute a.out: - The first time, I replace STATEMENTS by: printf("Hello, %s\n", "world"); $ CC -c s.c $ f77 m.o s.o -lC $ a.out Hello, world - The second time, I replace STATEMENTS by: cout << "Hello, world\n"; $ CC -c s.c $ f77 m.o s.o -lC $ a.out Bus error - core dumped $ adb $c __ostream__lshiftFPC__(14598,11ff1) _hello_() _MAIN__() _main(1,7fffef30,7fffef38) - The third time, I replace STATEMENTS by: char str[128]; cin >> str; $ CC -c s.c $ f77 m.o s.o -lC $ a.out Memory fault - core dumped $ adb $c __istream__rshiftFPC__(13320,7fffee5c) _hello_() _MAIN__() _main(1,7fffef30,7fffef38) - At this point, I got behold of the "s..c"-file. - The following line was contained in the "s..c"-file: _istream__rshiftFPC__ ( & cin , _auto_str ) ; - I don't know what the trouble could be. Maybe the f77-compiler?