Changes between Version 2 and Version 3 of VariableArgumentsUsingStdStdargExample
- Timestamp:
- 02/07/07 15:11:20 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
VariableArgumentsUsingStdStdargExample
v2 v3 5 5 == Description == 6 6 7 This demo shows typesafe variadic functions using std.stdarg and std.stdio. 7 This 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) 8 8 9 9 VariadicFunctionsExample shows using printf. 15 15 {{{ 16 16 #!d 17 /* To protect against the vagaries of stack layouts on different CPU architectures, 18 use std.stdarg to access the variadic arguments: */ 17 module ModName; 19 18 20 19 import std.stdarg; 74 73 }}} 75 74 75 == Sample Batch File == 76 77 {{{ 78 @echo off 79 set pgm=VariableArgumentsUsingStdStdargExample 80 dmd %pgm%.d 81 %pgm%.exe 82 pause 83 erase %pgm%.obj 84 erase %pgm%.map 85 }}} 86 76 87 == Output == 77 88 83 94 long 3 84 95 double 4.5 85 FOOFOO96 ModName.FOO ModName.FOO 86 97 float 7 87 98 char[] my str 88 99 }}} 89 100 101 == Required Version == 90 102 91 == Source == 92 93 || Link || http://www.dsource.org/tutorials/index.php?show_example=148 || 94 || Posted by || jcc7 || 103 Tested with Digital Mars D Compiler v1.0.