User Profile

Collapse

Profile Sidebar

Collapse
PieCook
PieCook
Last Activity: Oct 7 '07, 08:52 PM
Joined: Jul 19 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • PieCook
    replied to to create a simple game in C++
    in C
    Or use the free Allegro game library.
    See more | Go to post

    Leave a comment:


  • PieCook
    replied to do..while statement
    in C
    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.),...
    See more | Go to post

    Leave a comment:


  • PieCook
    replied to Converting strings into integers
    in C
    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:

    Code:
    int sum = 0;
    int length = strlen(str);
    for (i = length - 1; i >= 0; i--)
        sum += str[i] * pow(10, length - i);
    I did not run the code, so it might have a bug or two, but you get the idea.
    See more | Go to post

    Leave a comment:


  • PieCook
    replied to is int a class in c++
    in C
    Yes, if I'm not mistaken, int x = new int(10) looks like some Java or C# code.
    See more | Go to post

    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);
    ...
    See more | Go to post

    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:
    ...
    See more | Go to post
    Last edited by PieCook; Jul 24 '07, 05:46 AM. Reason: Add extra note.

    Leave a comment:


  • PieCook
    replied to What compiler do you use?
    in C
    I use the free Visual Studio.NET 2005 Express Edition.
    See more | Go to post

    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...
    See more | Go to post

  • 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....
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...