Im using C with header file dos.h where delay() function works correctly in main function but when I use delay() in another function and calls it, it corrupts whole program. the program refreshes continously. how I use delay() in another function?
Im using C with header file dos.h where delay() function works correctly in main function but when I use delay() in another function and calls it, it corrupts whole program. the program refreshes continously. how I use delay() in another function?
> but when I use delay() in another function and calls it, it corrupts whole program.
What does this mean?
Post some code which shows the problem you're facing.
But if your compiler is TurboC, and your OS is something like Windows XP or newer, then the only advice you need is to upgrade your compiler.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
bro Im using Turbo C++ 3.0 in windows xp
Well, if you can't post your code, and you're using TurboC, then all I can say is
Choose.
Visual Studio Express 2012 Products | Microsoft Visual Studio
smorgasbordet - Pelles C
Code::Blocks
Orwell Dev-C++ | Free Development software downloads at SourceForge.net
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Not withstanding the concern of your using an obsolete compiler, the delay() function shipped with Turbo C++ is not something that "corrupts whole program".
There are two likely explanations. The first is that you have implemented a function named delay() which is doing something it shouldn't. The other possible explanation is that some other unrelated code in your program is doing something untoward, such as writing to an area of memory it shouldn't.
Either way, without a small sample of representative code (i.e. code that compiles, links, and exhibits the unwanted symptoms when run) nobody can help you. If your program is large, do some work to create a small code sample that exhibits your problem.