Allegro problem...

This is a discussion on Allegro problem... within the C Programming forums, part of the General Programming Boards category; Why is it that this code works.... Code: #include <allegro.h> int main () { int i; allegro_init(); install_keyboard(); ureadkey(&i); allegro_message ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    752

    Allegro problem...

    Why is it that this code works....
    Code:
    #include <allegro.h>
    int main ()
    {
     int i;
     allegro_init();
     install_keyboard();
    
     ureadkey(&i);
     allegro_message ("%d ", i);
    
     return 0;
    }
    While the following code does nothing... (Can't even ^C out of it).
    Code:
    #include <allegro.h>
    int main ()
    {
     int i;
     allegro_init();
     install_keyboard();
    
     for (;;)
     {
      ureadkey(&i);
      allegro_message ("%d ", i);
     }
    
     return 0;
    }
    Please ignore typos, as I wasn't able to copy n' paste this one.
    Callou collei we'll code the way
    Of prime numbers and pings!

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    > Please ignore typos, as I wasn't able to copy n' paste this one.
    So how would we tell a typo from a real mistake?

    > allegro_message ("%d ", i);
    Try
    allegro_message ("%d\n", i);

    But if you don't want the newlines, then I suggest you read the manual to find out what the equivalent of fflush(stdout) is in allegro.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 02:04 AM
  2. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 09:37 AM
  3. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 06:18 AM
  4. problem in allegro with sprite leaving trail
    By Leeman_s in forum C++ Programming
    Replies: 18
    Last Post: 09-13-2002, 04:04 PM
  5. Problem declaring struct in allegro
    By bobish in forum Game Programming
    Replies: 7
    Last Post: 03-08-2002, 09:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21