Article View: gnu.g++.bug
Article #827Re: a little bug
From: Mike Stump
Date: Sat, 29 Aug 1992 14:33
Date: Sat, 29 Aug 1992 14:33
28 lines
1107 bytes
1107 bytes
It can and it does!
Please people, be a little more verbose in your postings.
Please explain WHY it cannot work. I just tried it, and it work
perfectly fine.
The strcpy (name, "hallo"); is a little dangerous when the size of
name is 0, but if your real lucky, the thing won't dump.
> Date: Fri, 24 Jul 92 10:34:20 +0200
> From: cool@anne.wifo.uni-mannheim.de (Stefan Kuhlins)
> Message-Id: <9207240834.AA08503@anne.wifo.uni-mannheim.de>
> To: bug-gcc@prep.ai.mit.edu
> #include <iostream.h>
> #include <string.h>
> int main()
> {
> int i = 3;
> cin >> i;
> char name[ (i ? 6 : 0) ]; // this can't work !!
> cout << sizeof(name) << endl;
> strcpy (name, "hallo");
> cout << name << endl;
> return 0;
> }
Technical Details
Message-ID:
<9208291433.AA29207@cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrsShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs From: mrs@cygnus.com (Mike Stump) Subject: Re: a little bug Message-ID: <9208291433.AA29207@cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Sat, 29 Aug 1992 14:33:04 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 29