www.digitalmars.com         C & C++   DMDScript  

D - Bug: toString

reply "Keir" <keir verizon.net> writes:
import c.stdio;
import string;

int main(char[][] args)
  {
  printf(toString(0));
  return 0;
  }

I would expect to see a zero when I run this...
instead I see "0123456789"

is anybody else having issues with this?
Feb 18 2003
next sibling parent Michael Slater <mail effectivity.com> writes:
Keir wrote:
 import c.stdio;
 import string;
 
 int main(char[][] args)
   {
   printf(toString(0));
   return 0;
   }
 
 I would expect to see a zero when I run this...
 instead I see "0123456789"
 
 is anybody else having issues with this?
 
There seems to be something amiss -- import c.stdio; import string; int main(char[][] args) { int n = 5; puts(toString(n)); puts(toString(0)); puts(toString(n)); printf("%s\n", "past puts"); return 0; } 56789 0123456789 56789 Error: Access Violation --ms
Feb 18 2003
prev sibling parent Burton Radons <loth users.sourceforge.net> writes:
Keir wrote:
 import c.stdio;
 import string;
 
 int main(char[][] args)
   {
   printf(toString(0));
   return 0;
   }
 
 I would expect to see a zero when I run this...
 instead I see "0123456789"
It's not returning a nul-terminated string. Using: printf (toStringz (toString (0))); Should format it correctly.
Feb 18 2003