I gave the values of imax, jmax, kmax and nmax as 8. care is taken to see that user input values are within bounds...
Main Topics
Browse All TopicsI have written a code which contains 4 dimensional array.After compling it shows zero errors.
but when i run it shows the following error:
NTVDM CPU has encountered an illegal instruction...
I referred to this solution..
http://support.microsoft.c
got any better ideas as i do not have Windows NT Workstation 4.0 or Windows NT Server 4.0,
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'd rather suggest to get a 32bit compiler than using the 16bit Turbo C++ (which is *very* old) - you can get VC++ Express for free from http://www.microsoft.com/d
>>>> NTVDM CPU has encountered an illegal instruction
The Turbo C++ seems to produce Win95 code (16bit or Win32s) which only supports preemptive multitasking. That's why at NT systems (NT4.0, W2000, XP, Vista, W7) the code was running in a NTVDM (a virtual machine) to not spoil the full multitasking of NT systems.
>>>> for(n=1;n<=2;n++)
>>>>{for(i=0;i<=imax;i++)
>>>>{for(j=0;j<=jmax;j++)
>>>>{for(k=0;k<=kmax;k++)
I don't know the purpose of these nested loops, but are you sure the loop boundaries are well-defined?
For instnace the n runs from 1 to 2 but you later only have elements like
cout<<Ez[i][j][k][n+1];
what means the last index is 2 or 3. Does that make sense?
The other indices run from 0 to max. If max == 8 they would run from 0 to 8 what is 9 times. Is that waht you want?
I also recommend to always running loops from 0 to max-1 by always use a < for the upper boundary
for (i = 0; i < imax; ++i)
In the loop *NEVER* use a (i+1) beside you would check the imax before. If doing it that way it makes life much easier, believe me.
Business Accounts
Answer for Membership
by: ikeworkPosted on 2009-10-12 at 08:41:40ID: 25552173
Hi ravikumarch,
The code allows to access the arrays beyond their bounds. If user enters "20" here:
cin>>imax;
then you access the array ep[19][n][n][n], but 9 is the highest possible index. You must validate the user-input, to check if it is the valid bounds.
ike