Mail Archives: djgpp/1995/06/23/16:02:19
Xref: | news-dnh.mv.net comp.os.msdos.djgpp:538
|
Newsgroups: | comp.os.msdos.djgpp
|
Path: | news-dnh.mv.net!mv!news10.sprintlink.net!news.sprintlink.net!howland.reston.ans.net!news-e1a.megaweb.com!newstf01.news.aol.com!uunet!gail.ripco.com!mambuhl
|
From: | mambuhl AT ripco DOT com (Martin Ambuhl)
|
Subject: | mysterious error -- Need
|
Sender: | usenet AT rci DOT ripco DOT com (Net News Admin)
|
Organization: | Ripco Internet BBS Chicago
|
Date: | Fri, 23 Jun 1995 07:38:32 GMT
|
Lines: | 38
|
To: | djgpp AT sun DOT soe DOT clarkson DOT edu
|
Dj-Gateway: | from newsgroup comp.os.msdos.djgpp
|
haasj AT infomatch DOT com (Jarrod Haas)
in <3sb51j$9bu AT berlin DOT infomatch DOT com> asks:
>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
almost all the information you posted is irrelevant (this is not a
flame, it is better to give more information than less); the only
relevant code to your problem is:
>char **args;
.....
> /*pass command line to global variable*/
> for (c = 0; c <= argc; c++)
> {
> args[c] = argv[c];
> }
args is never allocated any space, and (since global) is initialized to
NULL. Attempts to assign to args[0] ... args[argc-1] are to parts of
memory not in your address space = "Segmentation violation". Notice
that the violation occurs in a pointer 0x00000000, exactly what you
would expect when assigning using a NULL pointer.
--
* Martin Ambuhl net: mambuhl AT ripco DOT com
* Chicago, IL (USA) martin DOT ambuhl AT chessboard DOT com
- Raw text -