Xref: news-dnh.mv.net comp.os.msdos.djgpp:550 Path: news-dnh.mv.net!mv!news.sprintlink.net!cam.news.pipex.net!pipex!edi.news.pipex.net!pipex!oleane!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!scsing.switch.ch!news.belwue.de!fu-berlin.de!cs.tu-berlin.de!fauern!uni-regensburg.de!news.uni-regensburg.de!c9524 From: c9524 AT rrzc2 (Ulrich Windl) Newsgroups: comp.os.msdos.djgpp Subject: Re: mysterious error -- Need Help! Date: 22 Jun 1995 13:08:34 GMT Organization: University of Regensburg, Germany Lines: 36 References: <3sb51j$9bu AT berlin DOT infomatch DOT com> Reply-To: Ulrich Windl Nntp-Posting-Host: rrzc2.rz.uni-regensburg.de To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp In article <3sb51j$9bu AT berlin DOT infomatch DOT com> haasj AT infomatch DOT com (Jarrod Haas) writes: > I have this program that I'm writing under djgpp that refuses to run > properly. It compiles fine with no warnings or errors, but at runtime if use > 1 or more command line paramaters, i get: > > > RPG (Random Primitive Generator) 0.0 Beta -- Shape Generator for POV > (C) 1995 Jarrod Haas, Random Conformity Soft. > Segmentation violation in pointer 0x00000000 at d8:13ac > blah blah blah > call frame traceback EIPs: > 0x000013ac > > If it makes any difference, my commandline for the compile was > > /*Globals*/ > char **args; > int verbose; > int numargs; > > /*pass command line to global variable*/ > for (c = 0; c <= argc; c++) > { > args[c] = argv[c]; > } > numargs = argc; > Here "args" does point to nowhere (NULL). You can't store something there. You might insert a "args = malloc(sizeof(char *) * argc)". But why copying; you are just copying pointers!! Ulrich