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

Changes between Version 2 and Version 3 of VariableArgumentsUsingStdStdargExample

Show
Ignore:
Author:
jcc7 (IP: 192.149.244.9)
Timestamp:
02/07/07 15:11:20 (13 years ago)
Comment:

Tested with DMD 1.0

Legend:

Unmodified
Added
Removed
Modified
  • VariableArgumentsUsingStdStdargExample

    v2 v3  
    55== Description == 
    66 
    7 This demo shows typesafe variadic functions using std.stdarg and std.stdio. 
     7This demo shows typesafe variadic functions using std.stdarg and std.stdio. (To protect against the vagaries of stack layouts on different CPU architectures, use std.stdarg to access the variadic arguments) 
    88 
    99VariadicFunctionsExample shows using printf. 
    1515{{{ 
    1616#!d 
    17 /* To protect against the vagaries of stack layouts on different CPU architectures,  
    18 use std.stdarg to access the variadic arguments: */ 
     17module ModName; 
    1918 
    2019import std.stdarg;  
    7473}}} 
    7574 
     75== Sample Batch File == 
     76 
     77{{{ 
     78@echo off 
     79set pgm=VariableArgumentsUsingStdStdargExample 
     80dmd %pgm%.d 
     81%pgm%.exe 
     82pause 
     83erase %pgm%.obj 
     84erase %pgm%.map 
     85}}} 
     86 
    7687== Output == 
    7788 
    8394long    3 
    8495double  4.5 
    85 FOO     FOO 
     96ModName.FOO     ModName.FOO 
    8697float   7 
    8798char[]  my str 
    8899}}}  
    89100 
     101== Required Version == 
    90102 
    91 == Source == 
    92  
    93 || Link || http://www.dsource.org/tutorials/index.php?show_example=148 || 
    94 || Posted by || jcc7 || 
     103Tested with Digital Mars D Compiler v1.0.