[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Small code causing segfault
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Small code causing segfault
- From: admin_(_at_)_montereynet_(_dot_)_net
- Date: Wed, 28 Apr 2004 22:21:21 -0700 (PDT)
Newbie to c++, just wondering if anyone can help explain why I get a
segfault when running this with 'bame' = /home/username/
Thanks.
#include <stdlib.h>
#include <iostream.h>
int main()
{
const char *name = "BIGTEST";
char *bame;
cin >> bame;
setenv(name,bame,1);
system("find $BIGTEST");
return(0);
}
Visit your host, monkey.org