Doron Atik
New member
תוכנה שלא עובדת...
יש בעיה בתוכנה. הקומפיילר אומר שהוא מצפה לקבל סוגריים בשורה 10 (בהגדרה של הפונ') למרות שהסוגריים בסדר. מה הוא רוצה ?!? ענבל #include <stdio.h> #define size 3 #include <PROCESS.H> FILE *kelet,*pelet; float v[size]; float v1[size]; float v2[size]; float v3[size]; float result[size]; void read_vector(float v[],const int size) { int i; for(i=0;i<size;i++) fscanf(kelet," %f",&v); } void scalar_product(const float v1[],const float v2[],float result[],const int size) { int i; for (i=0;i<size;i++) result=v1*v2; } void vector_product(const float v1[],const float v2[],float result[],const int size) { result[0]=v1[1]*v2[2]-v1[2]*v2[1]; result[1]=v1[2]*v2[0]-v1[0]*v2[2]; result[2]=v1[0]*v2[1]-v1[1]*v2[0]; } void vector_sum (const float v1[],const float v2[],float result[],const int size) { int i; for (i=0;i<size;i++) result=v1+v2; } void main () { kelet=fopen("input.txt","r"); pelet=fopen("output.txt","w"); if(kelet==NULL) { printf("Canot open file"); exit(1); } if(pelet==NULL) { printf("Canot open file"); exit(1); } read_vector (v1[],size); read_vector (v2[],size); read_vector (v3[],size); printf ("%f %f %f",v1[],v2[],v3[]); fclose(pelet); fclose(kelet); }
יש בעיה בתוכנה. הקומפיילר אומר שהוא מצפה לקבל סוגריים בשורה 10 (בהגדרה של הפונ') למרות שהסוגריים בסדר. מה הוא רוצה ?!? ענבל #include <stdio.h> #define size 3 #include <PROCESS.H> FILE *kelet,*pelet; float v[size]; float v1[size]; float v2[size]; float v3[size]; float result[size]; void read_vector(float v[],const int size) { int i; for(i=0;i<size;i++) fscanf(kelet," %f",&v); } void scalar_product(const float v1[],const float v2[],float result[],const int size) { int i; for (i=0;i<size;i++) result=v1*v2; } void vector_product(const float v1[],const float v2[],float result[],const int size) { result[0]=v1[1]*v2[2]-v1[2]*v2[1]; result[1]=v1[2]*v2[0]-v1[0]*v2[2]; result[2]=v1[0]*v2[1]-v1[1]*v2[0]; } void vector_sum (const float v1[],const float v2[],float result[],const int size) { int i; for (i=0;i<size;i++) result=v1+v2; } void main () { kelet=fopen("input.txt","r"); pelet=fopen("output.txt","w"); if(kelet==NULL) { printf("Canot open file"); exit(1); } if(pelet==NULL) { printf("Canot open file"); exit(1); } read_vector (v1[],size); read_vector (v2[],size); read_vector (v3[],size); printf ("%f %f %f",v1[],v2[],v3[]); fclose(pelet); fclose(kelet); }