Quote Originally Posted by MK27 View Post
Wow, something strange definitely happened to that "+". Use %d instead of %c in your printf statement to find out what:

Code:
printf("\ninside 2...inside Power do while string = %d i = %d k = %d\n",string[i],i,k);
This will give the byte value of a signed char, a number between -128 and 127. These correspond to the ASCII table. Obviously, it is not a printable character, but it still must have a value and that may give you a clue (I would guess it is now 0 instead of 43, '+').

Do you do anything to the string before it entered the return_expo() function?
thanks a trilion bro! you were (are ) right, first of all instead of 43 it was 0 and that was because of the wrong string i used ( i used strtok! with a copy of original string, but i forgot to use the original and i used the copy ( which it seems it was truncated by strtok() )
. again thank you . i appreciate that , i really do