in C programming ; i printf something then i want to make the screen clear and printf another thing .It is for not making my program AMORPHOUS,how can i do that??
thanks.
|
Go4Expert Founder
|
![]() |
| 25Jun2009,16:41 | #2 |
|
clrscr is one of the easier option.
|
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 25Jun2009,20:10 | #3 |
|
That will NOT work for compilers which conform to ANSI C, 'cuz the clrscr() is no more present.
So, you can use system("CLS"); to clear screen, but that's OS specific.So it's better to write a user-defined func like : Code: C
Remember to #include <windows.h>.
|
|
Go4Expert Member
|
|
| 28Jun2009,02:11 | #4 |
|
Quote:
Originally Posted by SaswatPadhi error C2601: 'ClearScreen' : local function definitions are illegal |
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 28Jun2009,07:44 | #5 |
|
Quote:
Originally Posted by hoda Error C260 indicates that you are trying to declare a function inside a function. So, did you directly paste the above code inside your main() ??? You should not do that. You should paste the above function globally and call it from main() or wherever wherever required, this way : ClearScreen(); |



