From owner-freebsd-hackers Tue Feb 25 05:02:12 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA20533 for hackers-outgoing; Tue, 25 Feb 1997 05:02:12 -0800 (PST) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA20525 for ; Tue, 25 Feb 1997 05:02:05 -0800 (PST) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.8.5/CET-v2.1) with SMTP id NAA13943; Tue, 25 Feb 1997 13:01:57 GMT Date: Tue, 25 Feb 1997 22:01:57 +0900 (JST) From: Michael Hancock Reply-To: Michael Hancock To: Peter Haight cc: freebsd-hackers@freebsd.org Subject: Re: Static variables in shared libraries In-Reply-To: <3.0.1.32.19970225003040.00ff58e4@prognet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 25 Feb 1997, Peter Haight wrote: > I have a shared library which has the following definitions: > > const char* test_3 = "hello"; > const char* test_4 = test_3; > > If I dynamically load this shared library in my program and print the > variables, I get: > test_3 = "hello" > test_4 = 0x0 > > What's going on? Try news:comp.lang.c. "The C book" is also a necessity. For good jump start, also get "Expert C Programming" from SunPress. It has a coelancanth on the cover. Regards, Mike Hancock