Re: strlen within Classes (macro)

From: Masaharu Goto (gotom@hpyiddq.jpn.hp.com)
Date: Mon May 19 1997 - 06:24:22 MEST


Hello,

I've fixed following bug. I'll send the fix later. For the time being,
you can use a workaround below.

     int l;
     l=strlen(s);

Masaharu Goto

> 
> Dear roots,
> whats wrong with the following macro, I get segmentation violation from
> strlen. If I use this function in a macro without a class it works:
> 
> #include <iostream.h>
> #include <string.h>
> 
> class Simple{
> public:
>   Simple();
>   char *string;
> }
> Simple::Simple()
> {
>   char *s="xxxxx";
>   cout << s << endl;
>   int l=strlen(s);
>   cout << l << endl;
> }
> 
> Cheers,
> 
> ----------------------------------------------------------------------------
> Otto Schaile                    Sektion Physik der LMU Muenchen
> Phone: (+49 89)289 14070        Am Coulombwall 1, D-85748 Garching, Germany
> FAX:   (+49 89)289 14072        EMail: Otto.Schaile@Physik.Uni-Muenchen.DE
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:18 MET