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

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -