delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/13/20:06:42.1

From: "DooMWiz" <DooMWiz AT TicNet DOT Com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Random Number and Struct questions.
Date: Tue, 13 Apr 1999 18:12:41 -0500
Organization: The Internet Connection - ticnet.com (using Airnews.net!)
Lines: 25
Message-ID: <CD8E99C4749F0A4B.D1DB0CD232A70780.3FF06985D6C9014A@library-proxy.airnews.net>
X-Orig-Message-ID: <7f0kap$626 AT library3 DOT airnews DOT net>
References: <3712C239 DOT 68D4762C AT powerlynk DOT com>
Abuse-Reports-To: abuse at ticnet.com to report improper postings
NNTP-Proxy-Relay: library3
NNTP-Posting-Time: Tue Apr 13 18:34:49 1999
NNTP-Posting-Host: !Z4Be4F\L(NR]<# (Encoded at Airnews!)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

  I'm not too totally sure about some things you said, but I'll give it a
shot...embedded structs are easy.  To use a struct within another, make sure
you declare the first one before the second one.  To use your example (I
think) or something like it...

     struct targettype { int vars };
     struct shiptype { int var;  struct targettype blah[5] };

  To seed the random number generator, just do this:

          srand((unsigned int)(time(NULL)));
  (though I've been known to get the simplest things wrong from memory =)

--

--DooMWiz--
Doom Development Environment @
http://dde.tsx.org

calloc(1,sizeof(geek))  <-- irc.cs.cmu.edu
"Conformity Adheres to Normality" - DooMWiz
"If we stop living because we fear death, then we have already died." -
Raistlin


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019