473,800 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Plz help me with the characters showing.

hi,all
I write a snippet(in VC6.0 PLATFORM) to show the ASCII character
ranging from 0-255.
snippet:
#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
int main(int argc, char* argv[])
{
int i = 0;
for(i = 0; i < 255; i++)
{
printf("%d = %c\n", i, i);
}
getch();
return 0;
}
IT can normaly show 0-127,but cannot show 128-255 just like "219=?".
what's the problem?
Any one can help?
Thx.
-----------------pinkfog---------------

Apr 12 '06
15 1857
pinkfog wrote:
hi,all
I write a snippet(in VC6.0 PLATFORM) to show the ASCII character
ranging from 0-255.
There is no such thing. The ASCII character set is defined over 0-127.
snippet:
#include "stdafx.h" Not a standard header. Remove.
#include "stdio.h" Unless you have your own personal copy of stdio.h that you intend to
use, this is not the right way to include a standard header, Use
#include <stdio.h>
#include "conio.h" Not a standard header. Remonve
int main(int argc, char* argv[])
{
int i = 0;
for(i = 0; i < 255; i++)
{
printf("%d = %c\n", i, i);
}
getch(); Not a standard function. Remove or replace with a standard
function or macro. One such is getchar().
return 0;
}
IT can normaly show 0-127,but cannot show 128-255 just like "219=?".
what's the problem?
You implementation seems use the ASCII characters set and know that
it is defined only over the range of 0-127.
Any one can help?
Perhaps you should start by learning standard C. Then learn that your
code does not necessarily relate to ASCII at all; other encodings are
possible. In fact, you seem to want some other encoding, since you want
to display characters for values which are outside the defined range of
ASCII.
Thx.


Would it really have hurt your hand to type *two* more characters? Like
this:
Thanks
Apr 12 '06 #11
Martin Ambuhl opined:
pinkfog wrote:
Thx.


Would it really have hurt your hand to type *two* more characters?
Like this:
Thanks


It may have, as it's four more, *and* that "x" needs translating.

--
"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly)."
(By Matt Welsh)

<http://clc-wiki.net/wiki/Introduction_to _comp.lang.c>

Apr 12 '06 #12
Vladimir S. Oka wrote:
Martin Ambuhl opined:

pinkfog wrote:

Thx.


Would it really have hurt your hand to type *two* more characters?
Like this:
Thanks

It may have, as it's four more, *and* that "x" needs translating.


The string "Thx." has 4 characters.
The string "Thanks" has 6 characters.
In your arithmetic the value of 6-4 may be 4, but don't bother applying
for work anywhere that uses numbers.
Idiot.
Apr 12 '06 #13
Martin Ambuhl opined:

You didn't strike me as the one to not get the joke...
Vladimir S. Oka wrote:
Martin Ambuhl opined:

pinkfog wrote:
Thx.

Would it really have hurt your hand to type *two* more characters?
Like this:
Thanks

It may have, as it's four more, *and* that "x" needs translating.


The string "Thx." has 4 characters.


I do admit not counting a ".".
The string "Thanks" has 6 characters.
In your arithmetic the value of 6-4 may be 4, but don't bother
applying for work anywhere that uses numbers.
Now, still not counting the ".":

"Thx" differs from "Thanks" in 4 characters ("anks"), possibly 5 if you
count the "x" (that needs translating into "anks"). So, it does
require typing 4 extra characters ("anks"), and, if you want to be
very precise, one less ("x"), in which case we're both wrong, as it's
3, not 2 or 4.
Idiot.


And that was totally uncalled for.

Goodbye.

--
Either one of us, by himself, is expendable. Both of us are not.
-- Kirk, "The Devil in the Dark", stardate 3196.1

<http://clc-wiki.net/wiki/Introduction_to _comp.lang.c>

Apr 12 '06 #14
On Wed, 12 Apr 2006 17:37:45 +0200, "Richard G. Riley"
<rg****@gmail.c om> wrote in comp.lang.c:
On 2006-04-12, pinkfog <ch*******@gmai l.com> wrote:
hi,all
I write a snippet(in VC6.0 PLATFORM) to show the ASCII character
ranging from 0-255.
snippet:
#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
int main(int argc, char* argv[])
{
int i = 0;
for(i = 0; i < 255; i++)
{
printf("%d = %c\n", i, i);
}
getch();
return 0;
}
IT can normaly show 0-127,but cannot show 128-255 just like "219=?".
what's the problem?
Any one can help?
Thx.
-----------------pinkfog---------------


Look up "locale" and how character sets work. The characters > 127 can
be all sorts of wierd and wonderful things and will depend on the
platform, location, window, locale setting and installed fonts.


There are NO characters > 127 in Microsoft Visual C++ 6.0. The type
"char" is signed, and ranges from -128 to 127.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Apr 13 '06 #15
Jack Klein wrote:

<snip>
There are NO characters > 127 in Microsoft Visual C++ 6.0. The type
"char" is signed, and ranges from -128 to 127.


<OT>
Unless you set the option to tell it to make char unsigned.
</OT>
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Apr 13 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
9005
by: Roy W. Andersen | last post by:
I've been searching google about this for days but can't find anything, so I'm hoping someone here can help me out. I'm trying to create zip-files without needing the zip-file extension in PHP, mainly because I need the ability to both create and extract zip-files. I've tried a couple of classes found here and there, and they all seem to have the same problem. I'm currently using PclZip (http://phpconcept.net/pclzip/) but even the...
2
2069
by: lkrubner | last post by:
What I need to do is find out what characters in a string are not supported by the UTF-8 encoding. The problem arises when someone logs in and uses my php script to create a weblog post. They are presented with a form that has a textarea. If they type in words and then hit submit, then all is fine. But if they write their entry in WordPerfect or Microsoft Word or some such, and copy and paste it, then they might be bringing strange...
1
2055
by: Walt | last post by:
We are using ASP.net to develop a new website. The old website uses legacy ASP connecting to an Oracle database (9.2, W2k3, charecter set WE8ISO8859P1). The new site connects to the same database but using ASP.NET. Our problem is that extended characters are printing out as question marks. In particular, the "smart quote" characters that MS Word likes to use are showing up as question marks. We ran into a similar problem with the...
3
1431
by: thomasamillergoogle | last post by:
I am building a web page to show a TCP/IP raw packet. I need to show "special characters" on the web page I am working on. When I say "special characters" i am talking about tabs, whitespace, crazy unicode characters, etc etc. What is the best way to present this to the user? I am thinking that a large textarea is the only way to display it so it retains all the special characters.
2
1673
by: jaekim | last post by:
Visual .NET c# design view is showing "?????" for all the Korean characters in design view. In code view, it looks okay. Did anybody have this kind of problem with foreign characters?
1
1645
by: prasadoo | last post by:
Hi everyone, I am trying to populate DropDownList with French characters but for some characters like é,d' etc.it is not showing the exacts French characters. Can anybody help me how to populate DropDownList with French characters.
1
2208
by: Peter K | last post by:
Hi I am writing an application where I need to process some text read from files, and write information to a content-management-system. Unfortunately the CMS does not accept international characters in some text strings (eg for names of entities), like the Danish Å, Ø, Æ. Is there an inbuilt, or recognised, method of converting these types of characters to "ascii" text (to be honest I don't know if "ascii" is the
3
2927
by: ConfusedMay | last post by:
Hi, I have an access 97 database that need to be upgraded to 2003. The problem is now on the 2003, the description field in all of my reports are showing up in Chinese characters instead of English. This field is saved as OLE object. How can I fix this problem, since the same report is working just fine with access 97? Is it an access 2003 bugs or there's an issue with OLE object? Thank you in advance.
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10275
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.