Following is a program which first inputs a stream of alphabets by the user and is then supposed to clear the screen partially. But it does not seem to be doing its job. Can u please help me find wats wrong with this.
Code:#include<iostream>
#include<stdio.h>
int main()
{
char *scr=(char*)0xB8000000;
char str[80],c;
int i,row=0,col=0;
puts("Type the alphabets");
while((c=getchar())!=EOF)
{
char *v;
v=scr+row*160+col*2;
*v=c;
c+=2;
if(c==80)
{
row++;
c=0;
}
}
row=row/2; col=col/2;
while(1)
{
char *v;
v=scr+row*160+col*2;
*v=' ';
c-=2;
if(c==0)
{
row--;
c=80;
}
if(row==0 && col==0)
break;
}
return 0;
}