I have a simple C program that represents a loading screen within the console, but I can't get the cursor to hide. I tried cranking up the speed of the sleep function so that the cursor timer would be reset and the cursor would be gone but that doesn't work.
Any tips on how to hide the cursor?
Code:
#include <stdio.h>
#include <stdlib.h>
const int TIME = 1;
int main(int argc,char *argv[]){
int i;
while (1){
printf("loading");
for (i=0;i<3;i++){
sleep(TIME);
printf(".");
}
sleep(TIME);
printf("\r");
system("Cls");
sleep(TIME);
}
}
conio.h
on windows/dos, instead ofsystem("cls")
and such, pehaps you should be able to control the cursro too. On *nix os's there are some control charaters to do that, I don't know what the equivalent should be in windows. – Leakyconio.h
does, nor do I know what the correct statments are when using it. – Dubenko