LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Print all ASCII characters in C#? (https://www.linuxquestions.org/questions/programming-9/print-all-ascii-characters-in-c-867613/)

michaelinux 03-09-2011 11:38 PM

Print all ASCII characters in C#?
 
i want to print all ASCII characters kind of like a table, but i really don't have an idea of how to do it, i don't know if there is a built-in method or something to accomplish this, if not... i hope you guys can help me with the logic of the problem.
thank you.

Sergei Steshenko 03-10-2011 04:13 PM

Quote:

Originally Posted by michaelinux (Post 4285050)
i want to print all ASCII characters kind of like a table, but i really don't have an idea of how to do it, i don't know if there is a built-in method or something to accomplish this, if not... i hope you guys can help me with the logic of the problem.
thank you.

I do not know C#, but I'm sure there should be a function which takes integer as its argument and returns an ASCII character whose ASCII code the input integer.

Such a function in Perl: http://perldoc.perl.org/functions/chr.html .

AnanthaP 03-10-2011 07:44 PM

Pseudo code:
For (i=32;i<256;i++)
print i formatted as a single character

For "kind of table", consider an inner and outer loop inner loop to write a new line character after every "n" characters - say.

OK

Below 32 are special characters and their printing is terminal dependent.


All times are GMT -5. The time now is 09:23 PM.