Ok. This is got to be one of the weirdest errors I have faced. I have these 2 lines in my code
int id=i*2000*512+512*row+column;
if (id==1){printf("This is output %f %f %f %i \n",entire_red[id],entire_green[id],entire_blue[id],id);}
and it gives me the output
This is the output 0.000000 0.000000
0.000000 109456488.
I have no clue what’s happening!
The
%fformat specifier expects adouble(floatis implicitly converted todoublefor variadic functions). Ifvariable_redet al are notfloatordoublevariables, thenprintfwill be processing the arguments incorrectly, and that could explain why theidinteger is printing incorrectly.Try this:
Alternatively, ensure you are using the correct format specifiers for the
entire_red,entire_greenandentire_bluevariables.