Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 7 years ago

Language

Compiler

Options

Author

anonymous

over 7 years ago

$
prog.c: In function 'dmatrix':
prog.c:9:12: error: incompatible types when assigning to type 'double' from type 'void *'
     if ((a = malloc(nrow*sizeof(double *))) == NULL){
            ^
prog.c:16:35: error: subscripted value is neither array nor pointer nor vector
     for (i = nr1; i <= nr2; i++) a[i] = malloc(ncol*sizeof(double));
                                   ^
prog.c:17:35: error: subscripted value is neither array nor pointer nor vector
     for (i = nr1; i <= nr2; i++) a[i] = a[i] - nl1;
                                   ^
prog.c:17:42: error: subscripted value is neither array nor pointer nor vector
     for (i = nr1; i <= nr2; i++) a[i] = a[i] - nl1;
                                          ^
prog.c: In function 'fnc1':
prog.c:24:6: error: incompatible types when assigning to type 'double **' from type 'double'
     M=dmatrix(1,3,1,3);
      ^
prog.c:25:5: error: 'k' undeclared (first use in this function)
     k = 1;
     ^
prog.c:25:5: note: each undeclared identifier is reported only once for each function it appears in
prog.c:27:14: error: 'j' undeclared (first use in this function)
         for (j = 1; j <= 3; j++){
              ^
prog.c:28:18: error: 'i' undeclared (first use in this function)
             for (i = 1; i <= 3; i++){
                  ^
prog.c:30:31: error: 'delta' undeclared (first use in this function)
                     M[i][j] = delta[k] / 6;
                               ^~~~~
prog.c:39:1: error: expected ';' before '}' token
 }
 ^
prog.c:41:5: warning: 'main' is normally a non-static function [-Wmain]
 int main(){
     ^~~~
prog.c: In function 'main':
prog.c:42:5: warning: implicit declaration of function 'func1'; did you mean 'fnc1'? [-Wimplicit-function-declaration]
     func1();
     ^~~~~
     fnc1
prog.c: In function 'fnc1':
prog.c:43:1: error: expected declaration or statement at end of input
 }
 ^
prog.c:23:14: warning: variable 'M' set but not used [-Wunused-but-set-variable]
     double **M;
              ^
At top level:
prog.c:41:5: warning: 'main' defined but not used [-Wunused-function]
 int main(){
     ^~~~
Exit Code:
1