| delorie.com/archives/browse.cgi | search |
| From: | pradeeptob AT yahoo DOT com (Pradeepto K Bhattacharya) |
| Newsgroups: | comp.os.msdos.djgpp,comp.lang.c |
| Subject: | Recursions and Static declarations....?Is this wrong... |
| Date: | 18 Jul 2002 11:04:37 -0700 |
| Organization: | http://groups.google.com/ |
| Lines: | 32 |
| Message-ID: | <5a91d0ef.0207181004.49e67056@posting.google.com> |
| NNTP-Posting-Host: | 203.196.154.229 |
| X-Trace: | posting.google.com 1027015478 23145 127.0.0.1 (18 Jul 2002 18:04:38 GMT) |
| X-Complaints-To: | groups-abuse AT google DOT com |
| NNTP-Posting-Date: | 18 Jul 2002 18:04:38 GMT |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hello
Well I tried to write this function...it is crashing the computer
If i compile it with BorlandC++ 3 , DevC++ 4, LCC-Win32...but it works
pretty fine If I use Djgpp.
This is the funtion................
void do_mat(char matrix[][COLS])
{
static int si=0;
static int sj=0;
while(si<ROWS)
{
while(sj<COLS)
{
matrix[si][sj]='o';
if(++sj==COLS)
{
sj=0;
break;
}
else
do_mat(matrix);
}
si++;
}
}
Can I not use Static with recursions...why is it only working with
Djgpp and not with others...
All help will be appretiated.Thanks in advance.
Regards
Pradeepto
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |