+2002-04-01 Robert Boehne <rboehne@gnu.org>
+
+ * tagdemo/foo.cpp: Use C++ IO to catch problems linking to C++
+ runtime libraries.
+ * tagdemo/main.cpp: Ditto.
+
2002-03-16 Gary V. Vaughan <gary@gnu.org>
* TODO: Removed obsolete comments about RMS' package system.
// USA.
#include "foo.h"
-#include <stdio.h>
+#include <iostream.h>
#ifdef HAVE_MATH_H
#include <math.h>
int
foo(void)
{
- printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
+ cout << "cos (0.0) = " << (double) cos ((double) 0.0) << endl;
return FOO_RET;
}
int
hello(void)
{
- printf ("** This is libfoo (tagdemo) **\n");
+ cout << "** This is libfoo (tagdemo) **" << endl;
return HELLO_RET;
}
#include "foo.h"
#include "baz.h"
-#include <stdio.h>
+#include <iostream.h>
int
main (int, char *[])
{
- printf ("Welcome to GNU libtool tagdemo!\n");
+ cout << "Welcome to GNU libtool tagdemo C++!" << endl;
foobar_derived FB;
// Instantiate the derived class.
int value = fb->hello();
- printf ("foobar::hello returned: %i\n", value);
+ cout << "foobar::hello returned: " << value << endl;
if (value == HELLO_RET)
- printf("foobar::hello is ok!\n");
+ cout << "foobar::hello is ok!" << endl;
if (fb->foo() == FOO_RET)
- printf("foobar::foo is ok!\n");
+ cout << "foobar::foo is ok!" << endl;
// --------------
// barbaz_derived::baz() should return FOO_RET since it calls
// foobar_derived::foo(), which in turn calls ::foo().
if (bb->baz() == FOO_RET)
- printf("barbaz::baz is ok!\n");
+ cout << "barbaz::baz is ok!" << endl;
return 0;
}