Hello everyone,
This is my first time here. I happen to run into this site as I was looking for solutions for some c program I have to write for my programming class. Anyway I'm running into issues that I just don't see any reason for why they are happening. The code is correct, but they just don't work correctly. There is a load of them, but for now I'll stick to one.
In this case the one I want to talk about is the scanf function. It never works properly for me. So here is a little test i created to explain it...
double input ()
{
double x,y,z,rad;
printf("Please input data for one of the spheres... \n");
printf("Radius:");
scanf("%lf\n",&rad);
printf("X value:");
scanf("%lf\n",&x);
printf("Y value:");
scanf("%lf\n",&y);
printf("Z value:");
scanf("%lf\n",&z);
printf("%f, %f, %f, %f",x,y,z,rad);
Input:
Raduis: 9
5 <<<<< (notice how it just asks me to input something in the middle of nowhere)
X value:1
Y value:2
Z value: 3
Output:
5,1,2,9 <<<<<(5 became x and everything else was shifted down and no 3!!!!!)