forum

Home / DeveloperSection / Forums / Use of undeclared identifier “sum”

Use of undeclared identifier “sum”

Anonymous User252804-Aug-2015

I have repeated error 3rd time, but I could not found that what is mean of use of undeclared identifier ..

I wrote that program on function in objective-C

#import <Foundation/Foundation.h>

 

@interface Add:NSObject

 

/* method declaration */ - (int)add:(int)a andNum2:(int)b;

@end

@implementation Add

 

/* method returning the max between two numbers */ - (int)add:(int)a andNum2:(int)b {

/* local variable declaration */

int sum = a +b;

return sum;

}

@end

NSLog(@"sum is : %d", sum);// error this line    

  return 0;

}


Updated on 05-Aug-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By