I am trying to debug using printf. I have inserted it between for loops, but I do not receive the output of it. I am certain that the algorithm is continuing after it and arriving to the end, it's like the reader is ignoring it.
Here's the code :
for (i = 0; i < lower; ++i) {
buf3[i] = (buf[i] + buf2[i] )/2;
printf("\n %d",buf3[i]);
}
printf("hiiiiiiiiiiiiiiiiiiii %d",i);
for (i; i < upper; ++i) {
if (upper == num2) {
buf3[i] += buf2[i]/2;
printf("\n %d",buf3[i]);
}
else {
buf3[i] += buf[i]/2;
printf("\n %d",buf3[i]);
}
}
printf("\n %d",upper);
The "hiiiii..." message is the one not being seen on the screen. (I tried replacing it by many other messages such as int or anything else, but in vain. I also tried to put another printf right above the first for loop, again it returned nothing).
Please note that upper and lower aren't huge numbers.
Thanks in advance.