problems with variables in C on RS-6000 -- behaving like static

Joshua Lobel jnl at wjh12.harvard.edu
Thu Apr 18 07:57:31 AEST 1991


I'm having a problem with the C compiler on a IBM RS-6000 running AIX
3003.

When I run this program on the IBM RISC 6000 the variables in p1 act as if they
have static storage.  Why is this happening?
#include <stdio.h>

p1()
{
char a[5],b[5];
puts(a);
puts(b);
gets(a);
strcpy(b,a);
}

main()
{
p1();
p1();
}

This is the output:
Script started on Wed Apr 17 17:08:36 1991
/u/ts/drs>a.out
pass1
pass1
pass1
pass2

script done on Wed Apr 17 17:08:55 1991



More information about the Comp.unix.aix mailing list