Home Tutorial Iphone Examples Nslog NSLog double example code

 
 

Share on Google+Share on Google+
NSLog double example code
Posted on: July 29, 2009 at 12:00 AM
Advertisement
In this example we are discussing about NSLog function that actually prints the value of double.

The following code examples explains how one can print the value of double using NSLog function.

//
//  PrintDouble.h
//  DataTypes
//

#import <Foundation/Foundation.h>

@interface PrintDouble : NSObject

{

    double _double;   

}

-(void) print;

-(void) set_double: (double) n;

@end

The implementation of the PrintDouble class is as follows:

//
//  PrintDouble.m
//  DataTypes
//
//

#import "PrintDouble.h"

@implementation PrintDouble

-(void) set_double: (double) n

{

    _double = n;

}

-(void) print

{

    NSLog(@"double value is: %f", _double);

}

@end

Advertisement

Related Tags for NSLog double example code:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 29, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com