• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Directx

The Lone Gunman

Tosser amongst Tossers
Thanks received
102
Not realy a technical issue, but a mate has a lad (Robert) learning directx with C and C++ he has a project to draw a 4 sided pyramid (which works) but his solutionis smart enough to take user input for the number of sides.
Can anybody propose what may be occuring given the following.
Run the program

Robert inputs a 3
The program draws a pyramid with a 3 sided base
All is well, Hurrah
Run the program

Robert inputs a 6
The program draws a pyramid with a 6 sided base
All is well, Hurrah
Run the program

Robert inputs a 7
The program draws a pyramid with a 7 sided base
All is well, Hurrah




Run the program

Robert inputs an 8 (or more)
The program crashes reporting a memory error
Oh Dear.
 
Not realy a technical issue, but a mate has a lad (Robert) learning directx with C and C++ he has a project to draw a 4 sided pyramid (which works) but his solutionis smart enough to take user input for the number of sides.
Can anybody propose what may be occuring given the following.
Run the program

Robert inputs a 3
The program draws a pyramid with a 3 sided base
All is well, Hurrah
Run the program

Robert inputs a 6
The program draws a pyramid with a 6 sided base
All is well, Hurrah
Run the program

Robert inputs a 7
The program draws a pyramid with a 7 sided base
All is well, Hurrah




Run the program

Robert inputs an 8 (or more)
The program crashes reporting a memory error
Oh Dear.

Thank you for your query to the CUK technical help line
Put the code in and we'll debug it.
 
If he runs it through a debugger, he should be able to see what's causing the memory error rather than just poking about blindly in the dark.
 

Advertisers

Back
Top