Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 1 and Version 2 of OpCallExample

Show
Ignore:
Author:
jcc7 (IP: 192.149.244.9)
Timestamp:
11/06/06 16:50:28 (17 years ago)
Comment:

updated to use writefln

Legend:

Unmodified
Added
Removed
Modified
  • OpCallExample

    v1 v2  
    1111{{{ 
    1212#!d 
     13import std.stdio : writefln; 
    1314import std.string; 
    1415 
    4041{ 
    4142    /* and you can create class objects the in a c++ syntax */ 
    42     A a = A(500);  
    43      
     43    A a = A(500);      
    4444    A a2 = new A(567); 
    4545 
    46     printf("Number: %.*s\n", a.toString()); 
    47     printf("Number: %.*s\n", a2.toString()); 
     46    writefln("Number: %s", a); 
     47    writefln("Number: %s", a2); 
    4848} 
    4949}}} 
    5050 
     51 
     52== Sample Batch File == 
     53{{{ 
     54@echo off 
     55set pgm=OpCallExample 
     56dmd %pgm%.d 
     57%pgm%.exe 
     58pause 
     59erase %pgm%.obj 
     60erase %pgm%.map 
     61}}} 
     62 
     63 
     64== Expected Output == 
     65 
     66{{{ 
     67Number: 500 
     68Number: 567 
     69}}} 
     70 
     71 
     72== Tested Compiler and Operating System == 
     73 
     74 * Tested with DMD 0.173. 
     75 * Compiled and tested on Windows 2000. 
     76 
     77 
    5178== Source == 
    5279 
    53 Based on [http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/1539 digitalmars.D:1539]. 
    54  
    55 || Link || http://www.dsource.org/tutorials/index.php?show_example=88 || 
    56 || Posted by || jcc7 || 
    57 || Date/Time || Wed May 19, 2004 5:50 pm || 
     80Based on [http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=1539 digitalmars.D:1539].