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
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