top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the meaning of while(!RCIF) in C?

+3 votes
737 views
What is the meaning of while(!RCIF) in C?
posted Jul 20, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+3 votes

RCIF is a bit which get set when there is a data in the Hardware Queue. See the following code

unsigned char getch ()
{
unsigned char c;

/* wait until character is received */
while (!RCIF);

c = RCREG;
return(c);
}

In the above code control will wait at the while (!RCIF); and once there is a character the RCIF bit would be true and condition will fail and control will reach the next line c = RCREG...

answer Jul 20, 2015 by Salil Agrawal
Similar Questions
+3 votes
#include <stdio.h>
int main()
{
    char vowels[5]={'a','e','i','o','u'};
    int x;

    printf("Vowel Letters");
    for(x=0;x<=5;x++)
    {
         printf("\n %C",vowels[x]);
    }
}

Output

Vowel Letters
a
e
i
o
u
♣
Process exited after 0.1132 seconds with return value 3

What is the meaning of return value 3

+5 votes
#include<stdio.h>
#include<string.h>
main()
{
    char p[100];
    int i,len;
    printf("Enter a string\n");
    scanf("%[^\n]",p);
    len=strlen(p);
    for(i=0;i<len-1;i++)
    {
        if(a[i]==a[i+1])
              p[i]=p[i+1];
    }
    printf("String :  %s\n",p);
}
...