home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!stanford.edu!kronos.arc.nasa.gov!joshr
- From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
- Subject: Re: THINK C 5.0 Code overflow
- Message-ID: <1992Jul27.182827.19459@kronos.arc.nasa.gov>
- Keywords: error,C programming, THINK C 5.0, Mac
- Sender: usenet@kronos.arc.nasa.gov (Will Edgington, wedgingt@ptolemy.arc.nasa.gov)
- Nntp-Posting-Host: kronos-arclan.arc.nasa.gov
- Organization: NASA/ARC Information Sciences Division
- References: <1992Jul27.160800.18222@cs.few.eur.nl> <1992Jul27.172249.17584@news.iastate.edu>
- Date: Mon, 27 Jul 1992 18:28:27 GMT
- Lines: 45
-
- In article <1992Jul27.172249.17584@news.iastate.edu> niko@iastate.edu (Nikolaus E Schuessler) writes:
- >In article <1992Jul27.160800.18222@cs.few.eur.nl> christ@cs.few.eur.nl (Christ Leijtens) writes:
- >
- >> Question: Is there *any* way to get around this bound for
- >> the code and data, so we can continue porting the program to the
- >> Macintosh? We would like any information on porting programs from
- >> other implementation of the C-language to Macintosh THINK C 5.0.
- >>
- >
- >Yes, there is... You have to declare all arrays as pointers to arrays
- >and malloc them in a routine at the start of your program... A * real *
- >pain ...
- >
- >char x[1000];
- >
- >to char *x;
- >
- >...
- >
- >x = (char *) malloc(1000 * sizeof(char))
-
-
- Ummm, are you sure this is what you mean? it gets an array of 1000 chars
- from local memory, then again from malloc. In addition, isn't x, as declared,
- a constant pointer (my language may be incorrect, but i STRONGLY suspect
- the above code of being not what you meant).
-
- What I think you menat was
-
- {
- ...
- char *x;
- x = (char *) malloc(1000 * sizeof(char));
-
- }
-
- right?
- >
-
-
- --
- ----------------------------------
- #include <std/disclaimer.h> Josh Rabinowitz, Mac TCL programmer
- joshr@kronos.arc.nasa.gov
- "'I see', said the blind carpenter, as he picked up his hammer and saw".
-