This program is adapted from the book Decompiling Java, chapter 1.

using System;
public class Casting {
    public static void Main(String[] args){
        for(char c=(char)0; c < (char)128; c++) {
            Console.WriteLine("ascii {0} character {1}", (int)c, c);
The only real trick here is the cast to integer in the call to WriteLine; it would be nice for the decompiler to type the for loop variable (here c) as a char rather than as an integer.

It's surprising how many decompilers fail this simple test.

-- MikeVanEmmerik - 07 Mar 2003

Revision: r1.2 - 11 Mar 2003 - 02:48 - MikeVanEmmerik
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback