What is wrong with this code?

Hi All,


I am very new to objective C programming. I wrote this code but it is not working and I don't know why.

It is very basic program. The code is below.

#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
    int a = 3;
    int b = 4;
    int result = a + b;
    NSLOG(@"%i", result);
   
    return 0;
}


The problem is in line 7. it gives me error.

Implicit declaration of function 'NSLOG' is invalid in C99


Thanks in advance.

Answered by OOPer in 76533022

In Objective-C as well as in C, identifiers are case-sensitive. You need change `NSLOG` to `NSLog`.

Accepted Answer

In Objective-C as well as in C, identifiers are case-sensitive. You need change `NSLOG` to `NSLog`.

What is wrong with this code?
 
 
Q