Article View: be.comp.programming
Article #12838Segmentation Fault
From: Karel
Date: Wed, 26 Sep 2001 12:55
Date: Wed, 26 Sep 2001 12:55
23 lines
1519 bytes
1519 bytes
Waarom mag ik geen 2 strings inlezen na elkaar? De source:
#include <stdio.h>
main(void)
{
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:
<ofks7.72306$6x5.15824854@afrodite.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!opentransit.net!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,235d965c7bd3acb4,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2001-09-26 05:55:51 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!opentransit.net!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail From: "Karel" <karel@fd.com> Newsgroups: be.comp.programming Subject: Segmentation Fault Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <ofks7.72306$6x5.15824854@afrodite.telenet-ops.be> Date: Wed, 26 Sep 2001 12:55:48 GMT NNTP-Posting-Host: 213.118.69.113 X-Complaints-To: abuse@pandora.be X-Trace: afrodite.telenet-ops.be 1001508948 213.118.69.113 (Wed, 26 Sep 2001 14:55:48 MET DST) NNTP-Posting-Date: Wed, 26 Sep 2001 14:55:48 MET DST Organization: Telenet Internet