Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have attended many online coding competition, they usually mention the note that #include<conio.h> means conio.h header can not be used. I am not aware about all functions included by this header but curios to know that why it's not a good programming habit? If anybody can explains some of it's functions should not be used.

example clrscr().

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Well, conio.h is platform-specific. If you try to compile on Linux, your code will probably not compile. Also - using functions to manipulate the console window make your program less reusable than if you were using just standard input and output (you cannot redirect the stdin/stdout so easily).

If you are making rich console applications, you can instead use cross-platform libraries, such as ncurses.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...