GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 19-Aug-2006, 15:22
sandeepeecs sandeepeecs is offline
New Member
 
Join Date: Aug 2006
Location: hyderabad
Posts: 3
sandeepeecs is on a distinguished road

nested for loops


how many nested for loops can i use in my turbo c complier ( in general any c complier ) i have used 81 nested loops in a programme and complied in turbo c its showing some errors but in in gcc is compling and giving output why it is so eecsatri.blogspot.com
  #2  
Old 19-Aug-2006, 16:26
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: nested for loops


Welcome to GID....

Quote:
Originally Posted by sandeepeecs
how many nested for loops can i use in my turbo c complier ( in general any c complier ) i have used 81 nested loops in a programme and complied in turbo c its showing some errors but in in gcc is compling and giving output why it is so (atrilug)
That would be compiler dependent. They'd all be different.

And if you are nesting 81 loops, you might want to look at a redesign of your program. I can't think of any reason to nest that deep...

Also, please note that "some errors" has no meaning and we cannot help with indications of why they might be happening. Read the Guidelines for info needed for us to help you best.
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #3  
Old 19-Aug-2006, 22:52
alcoholic's Avatar
alcoholic alcoholic is offline
Member
 
Join Date: Nov 2005
Posts: 170
alcoholic is on a distinguished road

Re: nested for loops


Standard only guarantees minimum limits i.e In C89 it's 15 and in C99 it's 127.
__________________
Gravitation is not responsible for people falling in love.
-Albert Einstein
  #4  
Old 20-Aug-2006, 08:49
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,627
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: nested for loops


Quote:
Originally Posted by alcoholic
Standard only guarantees minimum limits i.e In C89 it's 15 and in C99 it's 127.
Furthermore (and maybe even more importantly), there is no guarantee that any version of Turbo C complies with either standard.

In case anyone is wondering about C++: The C++ standard doesn't impose any minimum, but "recommends" that tne nesting levels of compound statements, iteration control structures and selection control structures be at least 256. (But that's not actually required to qualify a given implementation as compliant.)

I gotta go with Walt on this one:
Quote:
Originally Posted by WaltP
you might want to look at a redesign of your program

Regardless of the capabilities of the compiler, I, personally don't see how I would keep track of that level of nesting. (How would I proofread the bloomin' thing? With indentation increasing with each nesting level the code just marches right off of the page.) But that's just me (and, I guess, Walt).


Regards,

Dave
 
 

Recent GIDBlogNARMY by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested For-loops problem stguisy CPP / C++ Forum 4 14-Oct-2005 13:18
Nested for loop with function Tori CPP / C++ Forum 11 08-Nov-2004 13:02
Help with nested for loops...please. sorry newbie keperry CPP / C++ Forum 14 16-Oct-2004 11:25
Help using nested for loops dontcare CPP / C++ Forum 1 03-Oct-2004 12:33
looped loops Marjolein CPP / C++ Forum 28 06-Jul-2004 08:55

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:37.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.