home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!demos!news-server
- From: michael@ovsen.msk.su (Michael Y. McAlcin)
- Subject: Re: Static global initialization outside of main() legal?
- References: <34727@sales.GBA.NYU.EDU>
- Date: Sat, 9 Jan 1993 15:05:10 GMT
- Reply-To: michael@ovsen.msk.su
- Organization: Ovsen Ltd.
- Sender: news-server@kremvax.hq.demos.su
- Message-ID: <AAcckJhC92@ovsen.msk.su>
- Lines: 24
-
- In comp.lang.c++ in <34727@sales.GBA.NYU.EDU>
- wlee@sales.GBA.NYU.EDU (Wai-Shing Lee) writes:
-
- >
- >static int *pointer ;
- >static int initialized=findvideomemory() ;
- >
- >static int makepointer(void)
- >{
- > pointer=(int*)calloc(10, sizeof(char)) ;
- >}
- >
- >I've traced it and sure enough makepointer() is called and pointer is assigned
- >a value before main() even starts. Is the portable, legal. I didn't look
- >to hard in my C++ book, but there weren't any obvious answers. Is this
- >C++, C or something I should stay away from?
- >
-
- See ARM 8.4
-
- Michael Y. McAlcin
- Ovsen Group Ltd. of Russia
-
-
-