[Freeciv-Dev] Re: newbie C question
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, 5 Mar 2002, Jules Bean wrote:
> So if you use a C++ compiler to compile C code, then I think pointers
> get initialised to '0' (NULL).
Not if they're automatic variables... at least, not with gcc / g++ on the
following testcase:
int main(void) {
char *ptr;
printf("ptr is %p\n", ptr);
return 0;
}
Move the char *ptr; outside of the function body, though, and
it's a different story...
Ben
--
ben@xxxxxxxxxxxxxxxxxxxxxx http://bellatrix.pcl.ox.ac.uk/~ben/
"It is quite a three-pipe problem."
- 'The Red-Headed League', Sir Arthur Conan Doyle
[Freeciv-Dev] Re: newbie C question, Raimar Falke, 2002/03/05
|
|