Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
How can we clear screen/consol on this online compiler
+1
vote
asked
Feb 20, 2020
by
anonymous
I am trying to do clear screen with the help of this compiler but clrscr() and system(cls") functions are not working
c
please-help
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
1 Answer
0
votes
answered
Feb 22, 2020
by
anonymous
U can use fflush function for such purpose
Syntax of fflush function is
fflush(stdin);
commented
Feb 28, 2020
by
anonymous
Ok, so I tried this:
#include <stdio.h>
int main()
{
printf("Hello World");
fflush(stdin);
printf("Hello World2");
return 0;
}
But the result is:
Hello WorldHello World2
In other words, commands are recognized (no error message during compilation) but their effects are ignored.
Exactly what is happenig if you try to use clrscr(); or Gotoxy(); from the well know "borland" i/o library.
I'm suspecting there is a bug with GDB online and the output windows.
(The strange fact is it all works fine under GDB online and Pascal.)
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...