2-Fraction2c.m

Send Snippet To: Save this snippet to Code Collector Pro -- view all durul's snippets
language: Objective-C
license: Other

Code for Snippet:

                
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
#import "Price.h"
#import "Fraction.h"   
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>
 
/*
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
 
     Fraction *frac1 = [[Fraction alloc] init];
     Fraction *frac2 = [[Fraction alloc] init];
 
 
     // Set first fraction to 2/3
 
     [frac1 setNumerator: 2];
     [frac1 setDenominator: 3];
 
     // Set first fraction to 3/7
 
     [frac2 setNumerator: 3];
     [frac2 setDenominator: 7];
 
     // Display the fractions
 
     NSLog (@"The value of the first fraction is");
     [frac1 print];
 
     NSLog (@"The value of the second fraction is");
     [frac2 print];
 
     NSLog (@"The numerator is %i", [frac1 numerator]);
     NSLog (@"The denominator is %i", [frac1 denominator]);
 
     NSLog (@" bol %f", [frac1 convert]);
     NSLog (@" bol %f", [frac2 convert]);
 
     [frac1 release];
     [frac2 release];
     [pool drain];
     return 0;
     }
 
     */
 
 
#define USER_PLIST_FULLPATH @"/Downloads/Apps.plist"
#define SECONDS_PER_MINUTE  60
#define debug(format, ...) CFShow([NSString stringWithFormat:format, ## __VA_ARGS__]);
 
 
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
 
    NSArray *array = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleKeyboards"];
    NSLog(@"Keyboards: %@", array);
 
    Fraction *frac1 = [[Fraction alloc] init];
 
    [frac1 setNumerator:9];
    [frac1 setDenominator: 3];
 
    NSLog (@"The value of the first fraction is");
    [frac1 print];
 
    [pool drain];
    return 0;
}
 
 
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 89
Date Added: 2015-12-29 18:09:30
Last Modified: 2016-07-19 12:05:44

Web Analytics