delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/10/15:22:45

From: tchuma AT sympac DOT com DOT au (Tim Chmielewski)
Newsgroups: comp.os.msdos.djgpp
Subject: Code problems
Date: 10 Sep 1999 17:03:08 GMT
Organization: Freevision
Lines: 36
Message-ID: <7rbdkc$l21$3@perki.connect.com.au>
NNTP-Posting-Host: mdm-4-02.sympac.com.au
Mime-Version: 1.0
X-Trace: perki.connect.com.au 936982988 21569 203.30.68.161 (10 Sep 1999 17:03:08 GMT)
X-Complaints-To: abuse AT connect DOT com DOT au
NNTP-Posting-Date: 10 Sep 1999 17:03:08 GMT
X-Newsreader: WinVN 0.99.9 (Released Version) (x86 32bit)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I know it's probably against the rules to post code here, but I can't work
out this problem:

tot.cpp: In function `void print_flrrm(int, int, int, int, int)':
tot.cpp:147: parse error before `{'
tot.cpp:153: `nasties' undeclared (first use this function)
tot.cpp:153: (Each undeclared identifier is reported only once
tot.cpp:153: for each function it appears in.)


CODE:

void look_ahead(char nasties, int floor, int ty, int &gf)
{
char nasties[3] = nasties;
int ty = ty;
ty = rand() % 1;
ty = ty * 3 + 1;
char what[10] = "";
what = nasties[ty];
int s =  0;
s = rand() % 1;
s = s * 5;
s = s + floor + ty * 2;
cout << "Ahead you see a ";
   for (int i = 0; i < 10; i++)
      cout << what[i];

cout << endl;
int gf = gf;
gf = 1;
}


Thanks.

- Raw text -


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