1024programmer News Can MFC display ASCII codes of 3, 4, 5, and 6 symbols (suit symbols of playing cards)

Can MFC display ASCII codes of 3, 4, 5, and 6 symbols (suit symbols of playing cards)

The symbols of the four suits of playing cards are required, but the characters within ASCII code 32 are undisplayable characters, which can be printed under the console program. as follows:


#include
using namespace std ;
int main()
{
cout<<char(3)<< endl;
cout<<char(4)<<endl;
cout<<char(5)<<endl;
cout<<char(6)<<endl;

getchar();
return 0;
}

But I can’t find the characters whose ASCII codes are 3, 4, 5, and 6 that can be displayed in MFC. Ask for advice. .

20 solutions

#1


This depends on the mode of your machine, system, and monitor. For example, cmd is different from traditional dos.

#2


#include “stdafx.h”

int main(int argc, char* argv[])

{

printf(“%c %c %c %c!\n”,3, 4 ,5, 6);

return 0;

}

It can be displayed under my win7 + vc6 console, but it may not work after posting it.

!

Press any key to continue

#3


What I’m talking about is whether these characters can be output in MFC. . Continue to ask. .

#4


Continue to ask. .

#5



#include
using namespace std ;
int main()
{
cout<<char('0' + 3)<<endl;
cout<<char('0' + 4)<<endl;
cout<<char('0' + 5)<<endl;
cout<<char( '0' + 6)<<endl;

getchar();
return 0;
}


#6


Quoting the reply of yuucyf on the 5th floor:

C/C++ code

#include

using namespace std ;

int main()

{

cout<<char('0' + 3)<<endl;

cout<<char('0' + 4)<<endl;

cout<<char('0' + 5)<<endl;

cout<<char('0' + 6)<<endl;

get…

I can’t even see my problem. .

I mean, I need to output the four symbols 3, 4, 5, and 6 in the ASCII code in MFC.

For example, output in the CEdit control. . .

#7


I can’t see your problem because the code you posted interferes with others.

Display these characters in the control, just display them directly, no need to use printf.

#8



CEdit m_edit;

CString str;
str.Format(_T("%c"), char(3));
m_edit. SetWindowText(str);

Can you try to show it?

#9


This reply was deleted by the moderator at 2011-11-10 10:02:30

#10


The reply was deleted by the moderator at 2012-01-16 08:57:35

#11


Just checked the GB18030 2005 standard, inThere is no Chinese character similar to these four characters in the national standard Chinese character set. It should be said that there are no these characters in the displayable Chinese characters. If the system is set to English, these ascii characters can be displayed on the window, but they cannot be used under the Chinese system. .

I haven’t had time to investigate the writing of other countries.

#12


Does not appear to be displayed. don’t know how to deal with

#13


After binding with the string variable, it should be possible

#14


Quoting the reply of zyrr159487 on the 13th floor:

After binding with the string variable, it should be possible

Please post it completely, I will try it, thank you

#15


Quoting the reply of yinxu2008 on the 14th floor:

Quoting the reply of zyrr159487 on the 13th floor:

It should be possible after binding with the string variable

Please post it completely, I will try it, thank you

If it is a CEDIT control, you can naturally add a variable of type CSTRING to bind it.

Right click, add variable, category-VALUE, variable type-CSTRING

#16


// related to the system code page

// If the code page of the system is GB2312, it cannot be displayed.

#17


Use the UNICODE character set, copy it to CString

#18


Quoting the reply of zyrr159487 on the 15th floor:

Quoting the reply of yinxu2008 on the 14th floor:

Quoting the reply of zyrr159487 on the 13th floor:

It should be possible after binding with the string variable

Please post it completely, I will try it, thank you

If it is a CEDIT control, you can naturally add a variable of type CSTRING to bind it.

Right click, add variable, category-VALUE, variable type-CSTRING

I added it in the same way. You can try it on VC first. There are not many codes. If it shows success, please tell me the method. . Thanks

#19


Hello

I am the moderator of this edition

This post has been unattended for many days

Please end the post in time

If you think the problem has not been solved, you can deal with it as an unsatisfactory post

In addition, this version has set
Summary of difficult problems

and pinned to the top of the page

Relevant regulations are explained in the post

You can submit a link to your post according to the regulations

If you don’t want to close the post now, just reply and explain

We will delete this notification

No response within three days after seeing this reply

We will force the end of the post

For relevant regulations, please refer to the interface
The interface version has specific measures for moderators to finish posts

#20


Quoting the reply of yinxu2008 on the 18th floor:

Quoting the reply of zyrr159487 on the 15th floor:

Quoting the reply of yinxu2008 on the 14th floor:

Quoting the reply of zyrr159487 on the 13th floor:

It should be possible after binding with the string variable

Please post it completely, I will try it, thank you

If it is a CEDIT control, you can naturally add a variable of type CSTRING to bind it.

Right click, add variable, category-VALUE, variable type-CSTRING

I added the same way, you VC first…

Tested on VS2005 no problem

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/can-mfc-display-ascii-codes-of-3-4-5-and-6-symbols-suit-symbols-of-playing-cards/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索