如题,做一个简单的转换实验 对话框中两个编辑框 (Edit1 Edit2) 和一个按钮,点击按钮将输入Edit1的字符转化为0、1形式的二进制代码显示在Edit2上,请问用什么函数,该怎样实现?
解决方案 »
- 一动对话框就停止录像以及保存初始化文件名问题
- 求解,大学生的困惑
- "基于VC++的数字电路实验室系统"怎么实现的哦!?
- 这个线程为什么结束不了
- 如何获取文件的修改时间?(要精确要毫秒级)
- 在应用程序中怎么启动屏幕保护程序?
- 请问在程序里面,如何设置IE的代理参数,我用的是VC
- 有关显示当前所有进程的操作。
- INSTALLSHIELD打包时怎么判断所安装的程序是否正在运行?在线放分
- 真奇怪,我问了这样一个问题,也没人理我,又是这个高手那个高手的,这个问题 :在explore的列表中看到的这个my.h前面有一个小的图标,
- sendmessage的问题
- error C2065: 'dllexport' : undeclared identifier
int i=0;
unsigned int value=0;m_edit1.GetWindowText(ch1); //获取Edit1的字符串for (i=0; i<ch1.GetLength(); i++)
{
value = (unsigned int) ch1[i];
ch2.Format("%08u", value);
ch3 += ch2;
}m_edit2.SetWindowText(ch3); //设置Edit2显示的字符串
char szText[] = {"Hello,132"};
BYTE* buf = NULL;
int len = sizeof(szText);
buf = new BYTE[len];
memcpy(buf, szText, len);
CString strText(_T(""));
char szTmp[64] = {0};
for(int i=0; i<len; i++)
{
_itoa(buf[i], szTmp, 2);
strText += CString(szTmp) + _T("\r\n");
}
AfxMessageBox(strText);
//{{AFX_DATA(CTest2Dlg)
enum { IDD = IDD_TEST2_DIALOG };
CEdit m_edit2;
CEdit m_edit1;
//}}AFX_DATA
CString str="",tmp="";
for(i=0;i<8;i++)
{
a[i] = pchar[k] & 2^i;
tmp.format("%d",a[i]);
str = str + tmp;
}
MessageBOx(str);
#include <stdlib.h>
#include <stdio.h>void main( void )
{
char buffer[20];
int i = 3445;
long l = -344115L;
unsigned long ul = 1234567890UL; _itoa( i, buffer, 10 );
printf( "String of integer %d (radix 10): %s\n", i, buffer );
_itoa( i, buffer, 16 );
printf( "String of integer %d (radix 16): 0x%s\n", i, buffer );
_itoa( i, buffer, 2 );
printf( "String of integer %d (radix 2): %s\n", i, buffer ); _ltoa( l, buffer, 16 );
printf( "String of long int %ld (radix 16): 0x%s\n", l,
buffer ); _ultoa( ul, buffer, 16 );
printf( "String of unsigned long %lu (radix 16): 0x%s\n", ul,
buffer );
}
OutputString of integer 3445 (radix 10): 3445
String of integer 3445 (radix 16): 0xd75
String of integer 3445 (radix 2): 110101110101
String of long int -344115 (radix 16): 0xfffabfcd
String of unsigned long 1234567890 (radix 16): 0x499602d2