From ec9e925aff2038a454e7b33ed3e4a88c7b4a946b Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 22 Jan 2003 22:03:14 +0000 Subject: Added Andreas Rottman's example. 2003-01-22 Murray Cumming * Added Andreas Rottman's example. --- examples/Makefile.am | 6 ++++++ examples/hello_world.cc | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 examples/Makefile.am create mode 100644 examples/hello_world.cc (limited to 'examples') diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..e1ac82f --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,6 @@ +LDADD = $(top_builddir)/sigc++/libsigc-2.0.la +AM_CPPFLAGS = -I$(top_srcdir) + +noinst_PROGRAMS = hello_world + +hello_world_SOURCES = hello_world.cc diff --git a/examples/hello_world.cc b/examples/hello_world.cc new file mode 100644 index 0000000..3febe35 --- /dev/null +++ b/examples/hello_world.cc @@ -0,0 +1,28 @@ +/* Copyright 2003, The libsigc++ Development Team + * + * Assigned to the public domain. Use as you wish without + * restriction. + */ + +#include +#include + +#include +#include + +using namespace std; +using namespace sigc; + +void print(const string &str) +{ + cout << str; +} + +main() +{ + signal printer; + + printer.connect(ptr_fun(&print)); + + printer("hello world\n"); +} -- cgit v1.2.1