Hi guys.
I got some work in C language, but i have one problem..I have three files, main and function.c + macros.h
Function.c - there are all functions of program
main.c - only main function
i have to use pointers, arrays, functions with a parameter.
OK now:
I have problem with one function with a parameter, here is:
void priklad1(float x, float y, float z, float v)
{
FILE *fr;
float *p_x;
float *p_y;
float *p_z;
float *p_v;
p_x=&x;
p_y=&y;
p_z=&z;
p_v=&v;
fr=fopen("vysledek.txt", "w");
printf("\n\t\t\t\tZadejte R1: _\b");
scanf("%f", &x);
printf("\t\t\t\tZadejte R2: _\b");
scanf("%f", &y);
printf("\t\t\t\tZadejte R3: _\b");
scanf("%f", &z);
printf("\t\t\t\tZadejte U: _\b");
scanf("%f", &v);
printf("\n\t\t\t\tRC = ?\n\t\t\t\tI = ?\n");
printf("\t\t\t-- ----------------------------");
printf("\n\t\t\t\[VYSLEDEK]\n");
printf("\n\t\t\t\t RC: %.2f\n", *p_x+*p_y+*p_z);
printf("\t\t\t\t I: %.2f\n", *p_v/(*p_x+*p_y+*p_z));
fclose(fr);
}
I want to make one variable than x,y,z,v so = float xxx[4], but how to make function with parameters with this array + pointers?
Sorry for this stupid post, Thanks for help