Logo

Programming-Idioms

Create the string representation s (in radix 10) of the integer value i.
Implementation
C++

Implementation edit is for fixing errors and enhancing with metadata. Please do not replace the code below with a different implementation.

Instead of changing the code of the snippet, consider creating another C++ implementation.

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "strconv"
s := strconv.Itoa(i)
my $s = "" . $i;
String s=((Integer)i).toString();
#include <stdlib.h>
char s[0x1000]={};
itoa(i,s,10);
$s = "$i";
let s = i.to_string();
import std.conv;
string s = i.to!string;
s = str(i)
var s = "$i";
uses SysUtils;
var
  _s: String;
  _i: Integer;
begin
  _s := IntToStr(_i);
end.
s = i.to_s
s = Integer.to_string(i)
let s = show i
import "strconv"
s := strconv.FormatInt(i, 10)
S = integer_to_list(I).
import "fmt"
s := fmt.Sprintf("%d", i)
var s = i.toString();
(let [s (str i)])
s = tostring(i)
string s = i.ToString()
S : String := Integer'Image (I);
val s = i.toString
String s = Integer.toString(i);
String s = String.valueOf(i);
(define s (number->string i))
$s = (string)$i;
$s = "{$i}";
(setf s (princ-to-string i))
val s = i.toString()
  write (unit=s,fmt=*) i
Dim myInt As Integer = 12345
Console.WriteLine(myInt.ToString)
let s = format!("{}", i);
var s = i + "";
String s = "" + i;
s = to_string(i)
s = "#{i}"
$s = "$i";
@import Foundation;
NSString *s=@(i).description;
$s = strval($i);
s := i asString.
Str(i,s);
String s = String.format("%d", i);
def s = "$i".toString()