curses.h file for getch

Joined
Oct 26, 2010
Messages
4
Reaction score
0
Points
1
greetings everyone!!!
its a fact that on xcode one don't have conio.h file instead curses.h can be used for using function like getch(). i did the same but my output is totally different
here is the program#include <stdio.h>
#include <ctype.h>
#include<curses.h>
int main()
{
char ch;
do{
ch=getch();
if(islower(ch))
ch=toupper(ch);
else
ch=tolower(ch);
putchar(ch);
}while(ch!='.');
return 0;
}
it is suppose to convert uppercase letter to lowercase and vice-versa.
if i use getchar it works fine but on using getch() output is infinite loop.
can anyone tell why this infinite loop is coming
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top