printability of extended ASCII characters
&nbsp(134 Views)
How do you discover if a character including extended ASCII characters
are printable By extended ASCII I mean codes above 7Fx0, for example
'', 84x0. The following dubious code works on Windows, ( MSVC and g+
+ ) but not on Linux.
bool is_printable( char c )
{
const wint_t unsigned_c( ( c >= 0 ) c : 256 + c );
return iswprint( unsigned_c ) != 0;
}
I am not actually sure what printable means in this context. What I
actually want to know is whether I can write such a character to file
and expect it to be redisplayed correctly in a text editor. Extended
ASCII characters are displayed in notepad and gedit, but not in a
terminal.

list all characters available
&nbsp(135 Views)
Hi
I'm trying to write an app and don't know how to start.
I'll have a selector with a list of true type fonts.
Each font will represent a different set of chars. Example
*arial-font
*arabic-font
*russian-font
*cyrillic-font
When the user select one of them, I should list all chars available in
the font.
With ansi characterset it's easy, just loop from 0-255 and print the
char representation of an integer value, but I don't know how to
achieve this.
Any idea

Unicode character in C++
&nbsp(106 Views)
Hi all,
In my application, I am reading a file and storing it in a
array of character. That is ascii format...now in certain situation I
get unicode character (or lets say junk character). I want to know
that whether it is plain ascii or Unicode...How can I

designing your own characters in C++?
&nbsp(147 Views)
Is there a way of designing your own characters in C++ (For example some
foreign symbols with accents etc...)
I am relatively inexperienced in C++, but in other programming languages it
used to be possible to design your character on a grid and by using binary
for the cordinates program it into the computer and display it alongside
"normal" characters.
Does such a possibility exist for pure DOS please
Cheers, Andy

Unicode to characters
&nbsp(189 Views)
all,
There could be flavors of this question discussed in the past, but I
could not really make a head/tail out of it.
I have bunch of unicode values stored in a string array and I want to
see the corresponding characters displayed in an excel file. How could
I go about doing that
vector unicodevalues; // has values 0041, 0042, ... 0410 etc.
(hexa decimal values)
for 0041 (assumes hex) I should see alphabet 'A' , a 'B' for 0042 ...
special character corresponding to 0x410.
I could live with a comma separated .csv file instead of a .xls to
view it in excel.
Please advice.

Remove first two characters from char* or from int?
&nbsp(149 Views)
I have a char *year that contains a 4-digit year (i.e 1929), I use the
following syntax c = atoi(year); to convert it to an integer. However
I must strip the first two numbers. I've tried to convert it from
char* to a string and use the erase function, which works, but then I
can't seem to convert the string it to an integer. I am impartial as
to when I remove the first two digits, meaning it can be done before
or after the conversion to int. In my example above the end result
should be an integer variable equalling 29. , yogi_bear_79 wrote:
>> c = atoi(year+2);
> Perfect!

Newbie Question (take it easy on me fellas) - Creating customASCII-style characters
&nbsp(126 Views)
Please don't bite me to much with the following post, (a little
nibbling doesn't hurt though).
When I was a child I owned an Amstrad CPC6128 home computer and liked
to fiddle around with the BASIC that came with it. One of my favourite
commands was (memory permitting) something like this;
DATA xyz$ (1, 1, 1, 1, 0, etc)
this allowed you to design your own ASCII-style characters in an 8x8
gird with 1's representing a white dot and 0 not. You could then call
this as you would any other single character.
I'm currently learning C++ (albeit from a book) and was wondering if
there was a similar command for use in console style applications.
I hope that you are able to help me with this and don't bite me to
much.

get wide character and multibyte character value
&nbsp(103 Views)
,
I need to know the wide character (unicode) and multibyte (UTF-8)
values of a character string of czech. I personally know nothing about
czech. Is the following approach correct
1. I use L on the character string and watch memory to get the wide
character representation of the character string in little endian
form;
2. I change the computer region/language to czech, and use function
WideCharToMultiByte, and use CP_ACP as input code page and use the L
character string as input to get the output multibyte character string
output from parameter lpMultiByteStr.
Is (1) and (2) correct Any more efficient and smart ways

copy unknown number of characters from cstring
&nbsp(115 Views)
Let's say I have a cstring: char str[] = " world";
and I have a needle: char n[] = "wo";
I find that the needle starts at the 5+1 position of the string.
How am I going to copy the characters up to this point, using the
header
--
Using (c++ string) it is possible in two ways:
1) for (int counter = 0; i < str.find(n); i++)
tmp += str[i];
2) str.substr();

Triming characters off the end of a stream
&nbsp(112 Views)
I have a strstream, which has a few characters at the end of the stream ')|'
to be exact, I want to remove them form the stream, but SetLength doesn't
work on strstream, and I can't find any other way to turnicate the stream.
- Dan

How can I fix the warning C4786 'identifier' : identifier wastruncated to 'number' characters in the debug information...?
&nbsp(157 Views)
I have a MyIOManager Object.
In this object I have a ""typedef map cmdMap""
I also have a CommandManager & Command Objects.
// MyIOManager class
....
typedef map commandMap;
....
class MyIOManager
{
....
commandMap cmdMap;
CommandManager * cmdManager;
Command * cmd
....
}
MyIOManager::StartIO()
{
....
cmd = cmdManager->CatchCommand( cmdMap );
....
}
// CommandManager class
Command * CommandManager::CatchCommand( ... )
{
....
// return a Command *...
}
But I get too many warnings like the following:
What is wrong
How can I fix it
I checked the MSDN Library... there is written that I should shorten
the Identifier names..., But I don't understand, I don't have at all
long name more than 255 characters...

Adding two character pointer
&nbsp(187 Views)
How to add two character pointer value
Eg:
char *a = "10";
char *b = "20";
char *d ;
Here i need to add the value of a and b ie., 10 +20 = 30
and have to store it in d.
But when i do (d = (int)a + (int)b ) i am getting an
error.
so please help me how to add a and b value. and store it in d.
At last how to print the value of d.
Please help me in this issue

accessing the characters of a word
&nbsp(140 Views)
In the following code, how do I get the program to print out each
letter of the word that *delete is pointing to separately I need to
access each letter separately. Rather I need to access the last letter
of the word.
char *delete = "CProgramming";
int i;
for(i=0;i

remove characters from a string
&nbsp(138 Views)
I am a newer, and now i encounter a simple question.
i want to erase all specified characters ,such as ',' , from a string.
which function should i call
for example:
string ls( "i ,am, a ,dog,");
thanks in advace
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]