I have the following code which increments an existing value of a new variable:
-(NSString *)increaseId:(NSInteger *)config_id{
NSLog(@"%d",config_id);//Show 0
NSInteger *varfg = 0;//Init
varfg = config_id +1;//In logic here the compiler do 0 + 1 = 1
NSLog(@"%d",varfg);// Show 8 ??
return varfg;
}
If the variable config_id
get value '0', when I incremment + 1, the value is 8!, I wonder why this happened and how can I fix this?