473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to display ASCII characters on C++

2
More specifically, in the input code, how can you display all of the displayable ASCII characters with codes in the range 32 to 255 and also include display 16 ASCII characters per line, which will display in the program output?
May 12 '10 #1
2 4878
whodgson
542 512MB
So am I right, you want an output like this:
Expand|Select|Wrap|Line Numbers
  1. " " 32,"!"33,"""34,.........."0"48
  2. "1"49..........................."A"65//and so on ?
Well the part in inverted commas should be OK. How would you write the code to output the ASCII code numbers? Use the mod % operator to limit the line length to 16 units of character data in a for loop.
May 13 '10 #2
donbock
2,426 Expert 2GB
Use isprint to confirm the character is printable so you don't mess up your display by sending control characters to it. Common practice is to print a period (.) for nonprintable characters.

Have you written any code yet?
May 13 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bartolomé Sintes Marco | last post by:
Hi, I have downloaded and installed Python 2.3 RC1 in a Windows 98 SE computer. IDLE 1.0 does not work very well: a) When I open with IDLE 1.0 RC1 a program written with IDLE 0.8, non-ASCII...
23
by: Stan Goodman | last post by:
I run a website for my very extended family. The site is not a static one, and pages are frequently added and changed. I constructed it by myself, but I can best be described as a casual and...
4
by: SB | last post by:
Hi, I'd like to display some non-ascii characters in a DOS window. I'm getting the characters from Windows Character Map, such as the Spade (U+2660) and a few others. However, I can't get it to...
4
by: wob | last post by:
Many thanks for those who responded to my question of "putting greek char into C string". In searching for an solution, I noticed that there are more than one version of "Extended ASCII...
3
by: JSM | last post by:
Hi, I am just trying to port an existing simple encryption routine to C#. this routine simply adds/substracts 10 ascii characters to each character in a text file (except quotes). The routine...
6
by: clintp | last post by:
I have a byte array that contains 8-bit ascii characters. I'm not particular about the codepage used to display them, but I have to preserve the position in the string with something and be able...
2
by: joakim.hove | last post by:
Hello, I am having great problems writing norwegian characters ćřĺ to file from a python application. My (simplified) scenario is as follows: 1. I have a web form where the user can enter his...
5
by: tushar.saxena | last post by:
This post is a follow up to the post at : http://groups.google.com/group/comp.lang.c++/browse_thread/thread/83af6123fa945e8b?hl=ug#9eaa6fab5622424e as my original question was answered there, but I...
10
by: silverburgh.meryl | last post by:
Hi, Is there a string function to trim all non-ascii characters out of a string? Let say I have a string in python (which is utf8 encoded), is there a python function which I can convert that...
7
by: Laszlo Nagy | last post by:
Peter Bulychev wrote: Please be more specific. There is no general solution. Unicode can handle latin, cyrilic (russian), chinese, japanese and arabic characters in the same string. There are...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.