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

C99 doesn't allow initializers in if-conditions, so this does not comp...

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:11:9: error: expected expression
    if (unsigned long long *const fib = calloc(length, sizeof *fib)) {
        ^
source_file.c:12:9: error: use of undeclared identifier 'fib'
        fib[0] = 0;
        ^
source_file.c:13:9: error: use of undeclared identifier 'fib'
        fib[1] = 1;
        ^
source_file.c:14:46: error: use of undeclared identifier 'fib'
        for (size_t i = 2; i != length; ++i) fib[i] = fib[i - 2] + fib[i - 1];
                                             ^
source_file.c:14:55: error: use of undeclared identifier 'fib'
        for (size_t i = 2; i != length; ++i) fib[i] = fib[i - 2] + fib[i - 1];
                                                      ^
source_file.c:14:68: error: use of undeclared identifier 'fib'
        for (size_t i = 2; i != length; ++i) fib[i] = fib[i - 2] + fib[i - 1];
                                                                   ^
source_file.c:15:16: error: use of undeclared identifier 'fib'
        return fib;
               ^
source_file.c:27:9: error: expected expression
    if (unsigned long long *const fib = fibonacci(length)) {
        ^
source_file.c:29:62: error: use of undeclared identifier 'fib'
        for (size_t i = 0; i != length; ++i) printf("%llu ", fib[i]);
                                                             ^
source_file.c:32:14: error: use of undeclared identifier 'fib'
        free(fib);
             ^
10 errors generated.

        

    
                
λ
.NET NoSQL database for rapid development