code for tower of Hanoi problem and there was one variable inside a function for toh which is used to count the moves to transfer the disks...so when I used static variable inside that function it gives the correct output and when static keyword is not used, it gives the wrong one..what is the reason behind it?
That's not an explanation. You can do many things with your counter. Who knows where you put it?
Обсуждают сегодня