This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem In returning

Hi
I had many c files in my project. Two of them are main.c and Print.c. I wrote a function delay() in Print.c. I call this function from main.c. After complete execution of delay() code didnot return to main.c. Rather it goes in middle of a function in Print.c.
Any body have the solution of my this problem.
Regards
Farhan Arshad

Parents
  • hi
    Stack is not over flow. I check the assembly code generated actually in main file when it calls the dalay function the address of next line is 0x0018. When it returns from the delay function it jumps on the 0x0018 of the file which contain the delay function. Here is my delay function.

    void delay(int j)
    {
    int i;
    	for(i=0;i<j;i++)
    	{
    	}
    }
    
    Regards
    Farhan Arshad

Reply
  • hi
    Stack is not over flow. I check the assembly code generated actually in main file when it calls the dalay function the address of next line is 0x0018. When it returns from the delay function it jumps on the 0x0018 of the file which contain the delay function. Here is my delay function.

    void delay(int j)
    {
    int i;
    	for(i=0;i<j;i++)
    	{
    	}
    }
    
    Regards
    Farhan Arshad

Children