c - Count from 1 to 1000 without using loops corver edge -


Follow a question: What was the question asked today and it is a duplicate of the old question, in which a code snippet was shown Repeat the main function:

This code means counting up to 10 without any loops, it rearranges the main functions pointer and when it reaches the required amount of print, this indicator Varies with the exit function.

  #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Zero main (ent j) {printf ("% d \ n", j); (And main + (and exit - & main) * (j / 10)) (J + 1); }  

Note I have changed the number of values, the value will be printed, I think function subtraction is the UB, but still I compile and this function is given to this Type runs:

  ./ mainexit 547  

For any reason, the values ​​considered to be printed are from 2 to 10. When I start the program from ./ mainexit 1 it will be printed until J 10 reaches and then the reference will be to exit, but when I start the program with 547 While addressing the first function in the resonation, it should do 57 * really weird stuff but instead it prints normally. Any idea on how the function returns to the main?

parameter j is not used according to your idea.

When you launch the command, the first argument of the main is the number of the command line ARG, so the first value of the first call on the main code Launch as ./ mainexit 547 in the form. And the loop is created, when it calls out when it reaches j 10.

So the value of your RG is not useful, try ./ mainexit hello it will give you the same results!


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -