You can use setjmp ,longjmp or goto to get desired result.
#includestdio.h
#includesetjmp.h
void print(int v)
{
int i=0;
jmp_buf env;
setjmp(env);
if(i=v)
{
printf(%d\n,i);
++i;
longjmp(env,1);
}
}
@Greed
in windows.. output is infinite loop and printing...
0
0
0
0
0
... infinite loop..
On Thu, Sep 23, 2010 at 9:57 AM, Greed shrishkr...@gmail.com wrote:
You can use setjmp ,longjmp or goto to get desired result.
#includestdio.h
#includesetjmp.h
void print(int v)
{
try in linux.it is working fine
On Thu, Sep 23, 2010 at 8:58 PM, coolfrog$
dixit.coolfrog.div...@gmail.comwrote:
@Greed
in windows.. output is infinite loop and printing...
0
0
0
0
0
... infinite loop..
On Thu, Sep 23, 2010 at 9:57 AM, Greed shrishkr...@gmail.com wrote:
The question is to get an algorithm or a program.
If it's a program then using execl() or fork() system call you can
code this.
The code will not be a recursion in a sense that we will not call
functions recursively but will call the programs (executable code)
recursively.
On Sep 22, 8:49 pm,