User Profile
Collapse
-
Or use the free Allegro game library. -
One problem I noticed is that you have x = x*x inside your loop. In most cases, you should not modify the loop counter except while incrementing it, although there are a few peculiar exceptions, of course. I assume you meant to say x2 = x*x instead.
Now if you notice the mathematical relationship between each number in the left and the corresponding value on the right, you'll notice that they're not squares (2*2 != 16, 3*3 !=64, etc.),...Leave a comment:
-
I was just about to suggest a custom-made function, but the other ones look far better. I was going to do something like this:
I did not run the code, so it might have a bug or two, but you get the idea.Code:int sum = 0; int length = strlen(str); for (i = length - 1; i >= 0; i--) sum += str[i] * pow(10, length - i);Leave a comment:
-
Yes, if I'm not mistaken, int x = new int(10) looks like some Java or C# code.Leave a comment:
-
Thank you for your help, but I'm afraid none of these function calls worked. I probably typed them in the wrong place. However, I got it to work otherwise.
Here is my test program:
...Code:#include<allegro.h> int main(void) { allegro_init(); set_gfx_mode(GFX_SAFE, 640, 480, 0, 0); install_keyboard(); textout_ex(screen, font, "Hello World!", 1, 1, 10, -1);Leave a comment:
-
Although it is to have more than one return statement in any C function, only one of them can be called. As soon as the first return statement is called, the function exits and other return statements will not be called. To see why, consider the example:
...Code:double convert_miles_to_kilometers(double mi) { double km; // Declare a new variable to hold the converted value. km = mi * 1.61; // Conversion:Leave a comment:
-
-
Visual C++ 8.0 (2005) with the Allegro game library: Missing MSVCR80.dll?
Error message: "The application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem."
Basically, I recently purchased a game programming book, and was trying to follow along. The book uses the Allegro game library, and I was trying to configure a Visual C++ 8.0 project to compile and link to the library.
First, I installed Allegro 4.2 by copying... -
No. If you go to http://msdn.microsoft.com/vstudio/express/downloads/ and download the free Express edition, it'll give you everything you really need, including the Basic IDE environment, ability to create console and GUI applications, etc... The Professional edition is used mostly for commercial companies, and it's expensive, but you won't really need it....Leave a comment:
No activity results to display
Show More
Leave a comment: