Mail Archives: djgpp/1998/01/28/09:23:30
On Thu, 29 Jan 1998, Zippy wrote:
> main(int argc, char *argv[])
> {
> char *d, *p, *n, *e;
> int dummy = fnsplit(argv[1], d, p, n, e);
> /* This splits a filename into drive, path, name and extension. */
>
> dummy = rename("oldname.txt", strcat(n, ".txt"));
> }
The varaibles d, p, n, and e all point into the blue, since they were not
initialized to point to some allocated space. Programs with such bugs can
have some real wierd behavior depending on environment where they run.
> Now, this is what I don't understand. Why do I need to set the variable
> when I am running the stand-along .exe file?
No, you just need to debug your program when something like that occurs.
- Raw text -