Solved

VC++ 6.0: fatal error C1061: compiler limit : blocks nested too deeply

Posted on 2006-11-22
3
1,569 Views
Last Modified: 2013-11-20
Hi,

While compiling I'm ereciving "fatal error C1061: compiler limit : blocks nested too deeply".
It's due to more than certain number of if - else statement.

Can you plesae let me know how do we fix that. It's urgent and I appreciate ealry reply reply.

Thanks
0
Comment
Question by:pbsmbc
3 Comments
 
LVL 4

Accepted Solution

by:
bdunz19 earned 500 total points
ID: 17998093
Hey pbsmbc,

MSDN says your up you know what creek (and you have no paddle)! If you go to:

http://msdn2.microsoft.com/en-gb/library/dcda4f64(en-us).aspx

You will see that you've reached the maximun nested blocks. My sugestion - well I've never seen a program with that many nested if's, ect - is to try to make some of your code into separate functions. Normally when somone has that many conditional statements, they have incorrectly structured their code and are not thinking modularly.

I'm willing to bet that if you look at your code, you have repeted sets of instructions. When you have that 9 out of 10 times, you can separate those blocks into a single function call.

Hope my comments will help you out and good luck,
Brandon
0
 
LVL 8

Expert Comment

by:YoungBonzi
ID: 18000389
Let's see your code, maybe we can help you rethink the logic.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 18001578
As bdunz19 says your design may be bad.
With nested if..else statements may you could achieve the same with a recursive function.  (Do you know what that is?)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now