I uploaded an avatar to prevent further confusion.
This will work fine, and is perfectly okay, despite what some very uptight people may tell you.
Imo there are two reasons why one should not use goto:
1) It is generally not regarded as a good way to program.
2) The code will not be easy to ...
Search found 9 matches
- Thu Oct 25, 2007 12:08 pm
- Forum: Beginners Help
- Topic: How to use Switch from within a loop?
- Replies: 16
- Views: 2150
- Mon Oct 22, 2007 8:56 pm
- Forum: Beginners Help
- Topic: How to use Switch from within a loop?
- Replies: 16
- Views: 2150
Re: How to use Switch from within a loop?
I'm pretty sure the break statement only exits out of its enclosing for/while/do loop or switch statement. You must have something else going on for the loop to be ending prematurely. I think so too. This proves it.
#include <iostream>
using namespace::std;
int main()
{
int a=0;
for (0;a<10;a ...
#include <iostream>
using namespace::std;
int main()
{
int a=0;
for (0;a<10;a ...
- Mon Oct 22, 2007 3:08 pm
- Forum: Beginners Help
- Topic: A problem with controls
- Replies: 8
- Views: 862
- Sun Oct 21, 2007 8:46 pm
- Forum: Beginners Help
- Topic: A problem with controls
- Replies: 8
- Views: 862
- Sun Oct 21, 2007 6:02 pm
- Forum: Beginners Help
- Topic: A problem with controls
- Replies: 8
- Views: 862
- Sun Oct 21, 2007 12:51 pm
- Forum: Beginners Help
- Topic: A problem with controls
- Replies: 8
- Views: 862
- Sun Oct 21, 2007 10:06 am
- Forum: Beginners Help
- Topic: A problem with controls
- Replies: 8
- Views: 862
A problem with controls
Why doesn't this work?
int a = 0;
SEvent event;
while (device->run())
{
if (event.EventType == EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
{
if (event.KeyInput.Key == KEY_KEY_W) a += 10;
}
The compiler doesn't give any error but when I press the w key nothing happens. (the a ...
int a = 0;
SEvent event;
while (device->run())
{
if (event.EventType == EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
{
if (event.KeyInput.Key == KEY_KEY_W) a += 10;
}
The compiler doesn't give any error but when I press the w key nothing happens. (the a ...
- Wed Aug 08, 2007 10:42 am
- Forum: Beginners Help
- Topic: Problems installing Irrlicht (Ubuntu 7.04)
- Replies: 5
- Views: 1504
- Wed Aug 08, 2007 8:41 am
- Forum: Beginners Help
- Topic: Problems installing Irrlicht (Ubuntu 7.04)
- Replies: 5
- Views: 1504
Problems installing Irrlicht (Ubuntu 7.04)
I tried to install Irrlicht... I ran make and this is what happened: (this is not the whole install process... the Terminal did'nt save the whole process)
COpenGLDriver.cpp:894: error: ‘GL_QUADS’ was not declared in this scope
COpenGLDriver.cpp:894: error: ‘glBegin’ was not declared in this scope ...
COpenGLDriver.cpp:894: error: ‘GL_QUADS’ was not declared in this scope
COpenGLDriver.cpp:894: error: ‘glBegin’ was not declared in this scope ...