C - Passing by value in Visual Studio -
i seem having strange issue in running program visual studio c++ 2010. here (very simplified) code:
#include <stdio.h> #include <stdlib.h> #include <math.h> void recieve(double, double); void simple_pass(); void recieve(double x, double y) { printf("%d %d\n", x, y); } void main(int argc , char **argv) { simple_pass(); } void simple_pass() { recieve (0.25, 0.25); recieve (0.25, 0.75); recieve (0.75, 0.5); }
when printing values, x 0 , y greater billion.
thanks!
%d
ints, %lf
doubles.
most compilers give warning these days...
Comments
Post a Comment