Is there any alternative for clrscr() and gotoxy in gcc ? I am using system("cls"); to clear screen but it doesn't identify cls as a valid command whereas in cmd cls is working perfectly on windows? can anyone please help ? i am using gcc as my compiler and using dev cpp and codeblocks as my IDEs. thanks in advance.
nitin1 15 Master Poster
Recommended Answers
Jump to PostUsing the OS command for clearing the screen is bad for security reasons. For example, someone could map cls (or clear) to another program, and yours would run it without realizing.
If you are worried about what's on the screen for others to see, just use a for loop printing …
All 7 Replies
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
nitin1 15 Master Poster
Adak 419 Nearly a Posting Virtuoso
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.