Home   Cover Cover Cover Cover
 

Formatted output

/csbook/solutions/07/A03.cs
using System;

class Test {
  
  static void Main(string[] arg) {
    foreach (char ch in arg[0])
      Console.WriteLine("{0}: 0x{1:x4}", ch, (int)ch);
  }
  
}

A call of Test Sample yields:

S: 0x0053
a: 0x0061
m: 0x006d
p: 0x0070
l: 0x006c
e: 0x0065