Article View: be.comp.programming
Article #12839Re: Segmentation Fault
From: Daisy
Date: Wed, 26 Sep 2001 13:23
Date: Wed, 26 Sep 2001 13:23
32 lines
1877 bytes
1877 bytes
"Karel" <karel@fd.com> wrote in message
news:ofks7.72306$6x5.15824854@afrodite.telenet-ops.be...
> Waarom mag ik geen 2 strings inlezen na elkaar? De source:
>
> #include <stdio.h>
>
> main(void)
> {
> char* string1, string2;
char *string1,*string2;
> printf("Geef getal: ");
> scanf("%s",string1);
> printf("Het ingevoerde getal is %s",string1);
> printf("\nGeef tweede getal: ");
> scanf("%s",string2);
> printf("\nHet ingevoerde getal is %s",string2);
> }
>
> De output:
>
> [14:50:47][karel@fdreactor:~/test]$ ./code
> Geef getal: 23
> Het ingevoerde getal is 23
> Geef tweede getal: 11
> Segmentation fault
> [14:50:52][karel@fdreactor:~/testcode]$
>
>
>
Technical Details
Message-ID:
<MFks7.72338$6x5.15835954@afrodite.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mailReferences:
<ofks7.72306$6x5.15824854@afrodite.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,235d965c7bd3acb4 X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2001-09-26 06:23:58 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail From: "Daisy" <daisy_ysiad@hotmail.com> Newsgroups: be.comp.programming References: <ofks7.72306$6x5.15824854@afrodite.telenet-ops.be> Subject: Re: Segmentation Fault Lines: 33 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <MFks7.72338$6x5.15835954@afrodite.telenet-ops.be> Date: Wed, 26 Sep 2001 13:23:56 GMT NNTP-Posting-Host: 213.118.55.77 X-Complaints-To: abuse@pandora.be X-Trace: afrodite.telenet-ops.be 1001510636 213.118.55.77 (Wed, 26 Sep 2001 15:23:56 MET DST) NNTP-Posting-Date: Wed, 26 Sep 2001 15:23:56 MET DST Organization: Telenet Internet