• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: curses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: curses


  • Subject: Re: curses
  • From: Eric Albert <email@hidden>
  • Date: Fri, 27 Aug 2004 01:15:28 -0700

On Aug 27, 2004, at 1:01 AM, Markian Hlynka wrote:

In xcode, is there a correct place to put the -lncurses flag? Currently
I have it in the project's "styles" tab under "Other linker flags". Is
that where it ought to go?

The most Xcode-ish way to do this is to add /usr/lib/libcurses.dylib to your project.


Finally, if anyone would care to tell me why my code is acting funny,
I'd appreciate it! :)
(it's acting as though it only sees a character after the subsequent
character is pressed.)

   do
   {
     foo = getch();
     printf("Character was: %c\n",foo);
   }while (foo!='q');

That's because printf writes to stdout, which is buffered by default. stderr is not buffered, so you can either use
fprintf(stderr, "Character was: %c\n", foo);
or
printf("Character was: %c\n", foo);
fflush(stdout);


(Tip: You could figure this out by running the program, attaching to it with gdb from another window, and putting a breakpoint on the printf line. Then you'd see that when you hit that line foo has the expected value, but the output doesn't actually appear on your screen until the next time around.)

Hope this helps,
Eric
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >curses (From: Markian Hlynka <email@hidden>)

  • Prev by Date: curses
  • Next by Date: Re: No Way to change Tab View Item in Interface Builder
  • Previous by thread: curses
  • Next by thread: Leak problem in Cocoa NSMutableArray/objectEnumerator
  • Index(es):
    • Date
    • Thread