C (165/301)

From:Ben Hutchings
Date:27 Aug 99 at 00:08:24
Subject:Re: Re: ExecBase & 'RESET:starting PC' exception

From: Ben Hutchings <womble@zzumbouk.demon.co.uk>

On Fri, Aug 27, 1999 at 12:42:39AM +0100, Andrew Markwell wrote:
> From: Andrew Markwell <andrewmarkwell@ukonline.co.uk>
>
> On 27-Aug-99 did write:
> > From: Ben Hutchings <womble@zzumbouk.demon.co.uk>
> >
> > On Thu, Aug 26, 1999 at 03:28:18PM +0000, andrewmarkwell@ukonline.co.uk wrote:
<snip>
> >> try
> >> {
> >> blahblah=somecode();
> >> if(!blahblah)
> >> throw "something went wrong";
> >> }
> >> catch(char *error)
> >> {
> >> cout << error;
> >> }
> >> }
> >
> > You should use const char * here, not char *.
> >
> er, why?

String literals are arrays of const char.



Ben Hutchings - womble@zzumbouk.demon.co.uk, http://www.zzumbouk.demon.co.uk
Team *AMIGA* | Jay Miner Society | Linux - the choice of a GNU generation
Klipstein's 4th Law of Prototyping and Production:
A fail-safe circuit will destroy others.