What is thr proper way to have an array of strings w/o having to deal with malloc and such.. i've tried several varients.. include these which all segfault..
what is the correct way to do this..Code:char *randusername() { char *names[2][12] = { {"ltorvalds"}, {"foobar"} }; return names[0][0]; } char *randusername() { char *names[2][12] = { {"ltorvalds"}, {"foobar"} }; return names[0]; } char *randusername() { char *names[2][12] = { "ltorvalds", "foobar" }; return names[0][0]; } char *randusername() { char *names[2][12] = { "ltorvalds", "foobar" }; return names[0]; }
Thanks..



LinkBack URL
About LinkBacks


