Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Lab 11v0.6

Language: Layout:
+ ] Compiler args - ] Show input
Compilation time: 0.12 sec, absolute service time: 0,21 sec 
edit mode |  history  | discussion
Error(s):
source_file.c: In function ‘add’:
source_file.c:10:8: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].d;
        ^
source_file.c:10:15: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].d;
               ^
source_file.c:11:8: error: subscripted value is neither array nor pointer nor vector
     b=F[1].n*F[0].d;
        ^
source_file.c:11:15: error: subscripted value is neither array nor pointer nor vector
     b=F[1].n*F[0].d;
               ^
source_file.c:12:8: error: subscripted value is neither array nor pointer nor vector
     B=F[0].d*F[1].d;
        ^
source_file.c:12:15: error: subscripted value is neither array nor pointer nor vector
     B=F[0].d*F[1].d;
               ^
source_file.c: In function ‘subtract’:
source_file.c:19:8: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].d;
        ^
source_file.c:19:15: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].d;
               ^
source_file.c:20:8: error: subscripted value is neither array nor pointer nor vector
     b=F[1].n*F[0].d;
        ^
source_file.c:20:15: error: subscripted value is neither array nor pointer nor vector
     b=F[1].n*F[0].d;
               ^
source_file.c:21:8: error: subscripted value is neither array nor pointer nor vector
     B=F[0].d*F[1].d;
        ^
source_file.c:21:15: error: subscripted value is neither array nor pointer nor vector
     B=F[0].d*F[1].d;
               ^
source_file.c: In function ‘multiply’:
source_file.c:28:8: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].n;
        ^
source_file.c:28:15: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].n;
               ^
source_file.c:29:8: error: subscripted value is neither array nor pointer nor vector
     b=F[0].d*F[1].d;
        ^
source_file.c:29:15: error: subscripted value is neither array nor pointer nor vector
     b=F[0].d*F[1].d;
               ^
source_file.c:30:39: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                       ^
source_file.c:30:46: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                              ^
source_file.c:30:53: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                                     ^
source_file.c:30:60: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                                            ^
source_file.c: In function ‘divide’:
source_file.c:35:8: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].d;
        ^
source_file.c:35:15: error: subscripted value is neither array nor pointer nor vector
     a=F[0].n*F[1].d;
               ^
source_file.c:36:8: error: subscripted value is neither array nor pointer nor vector
     b=F[0].d*F[1].n;
        ^
source_file.c:36:15: error: subscripted value is neither array nor pointer nor vector
     b=F[0].d*F[1].n;
               ^
source_file.c:37:39: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                       ^
source_file.c:37:46: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                              ^
source_file.c:37:53: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                                     ^
source_file.c:37:60: error: subscripted value is neither array nor pointer nor vector
     printf("{%d/%d)*(%d/%d) = %d/%d",F[0].n,F[0].d,F[1].n,F[1].d,a,b);
                                                            ^
source_file.c: In function ‘main’:
source_file.c:55:17: error: incompatible type for argument 1 of ‘add’
             add(F);
                 ^
source_file.c:8:5: note: expected ‘fraction {aka struct <anonymous>}’ but argument is of type ‘fraction * {aka struct <anonymous> *}’
 int add(fraction F){ 
     ^
source_file.c:62:22: error: incompatible type for argument 1 of ‘subtract’
             subtract(F);
                      ^
source_file.c:17:5: note: expected ‘fraction {aka struct <anonymous>}’ but argument is of type ‘fraction * {aka struct <anonymous> *}’
 int subtract(fraction F){ 
     ^
source_file.c:70:22: error: incompatible type for argument 1 of ‘multiply’
             multiply(F);
                      ^
source_file.c:26:5: note: expected ‘fraction {aka struct <anonymous>}’ but argument is of type ‘fraction * {aka struct <anonymous> *}’
 int multiply(fraction F){ 
     ^
source_file.c:77:20: error: incompatible type for argument 1 of ‘divide’
             divide(F);
                    ^
source_file.c:33:5: note: expected ‘fraction {aka struct <anonymous>}’ but argument is of type ‘fraction * {aka struct <anonymous> *}’
 int divide(fraction F){ 
     ^
source_file.c:47:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&c);
    ^
source_file.c:51:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].n);
             ^
source_file.c:52:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].d);
             ^
source_file.c:53:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].n);
             ^
source_file.c:54:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].d);
             ^
source_file.c:58:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].n);
             ^
source_file.c:59:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].d);
             ^
source_file.c:60:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].n);
             ^
source_file.c:61:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].d);
             ^
source_file.c:66:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].n);
             ^
source_file.c:67:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].d);
             ^
source_file.c:68:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].n);
             ^
source_file.c:69:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].d);
             ^
source_file.c:73:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].n);
             ^
source_file.c:74:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[0].d);
             ^
source_file.c:75:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].n);
             ^
source_file.c:76:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&F[1].d);
             ^