recursion - How do I write a recursive delay function in C -


As part of the fun coding session, my friend was working on writing delays in C, I mainly The program does not work in C, although I used to do it, I wanted to write one to use recursive but whatever I wanted to do was not quite capable of achieving .... which is delayed , Say 20 milliseconds. I think I have some logic missing here. How do I write a delayed function using recycling. Currently my code looks like this, it must be addressed by the second range in milliseconds.

  #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Zero delay (unsigned long * d) {while (* d--> 0) {delay (d); }} Int main () {unsigned long del = 200; Delay (& amp; Dell); Return 0; }    

It looks like a very bad idea in general; In most environments where the meaning of busy-looping makes sense, you can not really afford the stack, it is only going to be consuming for delay.

He said, I think it has failed to make index-oriented

  zero delays (unsigned long D) {if (D> 0) If this is delayed, then it can be anything:  (D-1); }   

Of course, there is no no connection between the actual delay generating d , which depends on a whole bunch of factors OP has not disclosed, and I fail to deny seriously to try to get this information.

In addition to while the type of robbery is "this recursive" mentality

Comments

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -