Is this ok??

John E. Davis davis at pacific.mps.ohio-state.edu
Thu Mar 7 12:35:46 AEST 1991


Hi,

   The following code works on sun4 and ultrix but crashes on VMS.  Just when
I thought I understood pointers.....

#include <stdio.h>
void fm2(s)
char **s;
{
    *s = "Hello\n";
}

void fm1(s)
char **s;
{
    char *ss;
    fm2(&ss);
    *s = ss;
}

int main()
  {
      char *s;

      fm1(&s);
      (void) fputs(s,stdout);
      return(0);
  }

I expect to `hello' but I fail on VMS.  I get a `symbolic dump stack ...'.
What is wrong???

Thanks,
--
John

  bitnet: davis at ohstpy
internet: davis at pacific.mps.ohio-state.edu



More information about the Comp.lang.c mailing list