From owner-freebsd-questions Sun Sep 6 06:38:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA17612 for freebsd-questions-outgoing; Sun, 6 Sep 1998 06:38:19 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from lab.cba.ualr.edu (lab.cba.ualr.edu [144.167.120.221]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA17606 for ; Sun, 6 Sep 1998 06:38:18 -0700 (PDT) (envelope-from joe@lab.cba.ualr.edu) Received: from njal (joe@access63.mod1.ualr.edu [144.167.7.63]) by lab.cba.ualr.edu (8.8.7/8.8.7) with SMTP id IAA04235; Sun, 6 Sep 1998 08:38:20 -0500 Date: Sun, 6 Sep 1998 08:38:05 -0500 (CDT) From: Joe X-Sender: joe@njal To: Stephen Derdau cc: "FreeBSD .org" Subject: Re: Core DUMP In-Reply-To: <35F2898D.42971A56@bit-net.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG See comments below in program. There are no secret messages in this signature file. On Sun, 6 Sep 1998, Stephen Derdau wrote: > compiling a small program on my system " see sig. below also " > " FreeBSD 2.2.7-STABLE #0:" > The program compiles but when I run the program I get this > error message" > > -- Bus error (core dumped) > > Here is the the file : > > #include > > int main(void) > { > char c1, c2, c3; > int i; > float x; > double y; > > printf("\n%s\n%s", "Input three characters," > "an int, a float, and a double: "); > scanf("%c%c%c%d%f%lf" , &c1, &c2, &c3, &i, &x, &y); > printf("\nHere is the data that you typed in:\n"); > printf("%3c%3c%3c5d%17e%17e%\n\n", c1, c2, c3, i, x, y); error ----> ^^ put a % before the c snd 5 and lose the 3's before the c's. When you're doing the scanf you're working with single characters, not strings. That's probably why you're getting a core dump. > return 0; > } > % > > > When I more the a.out file I noticed this also : > > ^@Failure reading ld.so > ^@Bad magic: ld.so > ^@Cannot map ld.so (text) > ^@Cannot map ld.so (data) > ^@Cannot map ld.so (bss) > ^@ld.so failed^@: ^@ > > > Thank You > > /SD > FreeBSD 2.2.7-STABLE #0: Mon Aug 24 02:20:10 EDT 1998 > **http://www.freebsd.org/search.html "Alot of answers found here see > FAQ's"** > ***** FreeBSD IT's HARD TO BELIEVE IT IS FREE ! http://www.FreeBSD.org > ***** > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message