cmap:这个程序有什么问题,怎么输出总是一样的?

来源:百度知道 编辑:UC知道 时间:2024/06/03 23:08:31
CMap<CString, LPCSTR,float, float> m_cMap;

CStdioFile file;
CStdioFile mfile;

CString str,str1;
file.Open("1.txt",CFile::modeRead);
//file.Open("2.txt",CFile::modeRead);

while(file.ReadString(str))//读取一行文本到str中,遇到回车换行符停止读取,回车和换行符均不读到str中,尾部也不添加”0x00”。

{
//if(file.ReadString(str1))

//CMapStringToString m_shi;

m_cMap.SetAt(str,i);

i=+1.5;
cout<<str<<" "<<m_cMap[str]<<endl;

}
//int j=m_cMap.Lookup(5, str);
//AfxMessageBox(str);
//cout<<j<<endl;
/*//m_cMap.SetAt(9826033, "张A");
//m_cMap.SetAt(9923063, "张B");
//m_cMap.SetAt(9923093, "张C");
m_shi.SetAt("wang","王");
m_shi.SetAt("wei","伟");
m_shi.SetAt("cai","才");
CString strName;
<

using System;
using System.Collections.Generic;
using System.Text;

namespace baiduzhidao520_1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("input");
string input = Console.ReadLine();
char[] inputchar = input.ToCharArray();
for (int i = 0; i < inputchar.Length; i++)
{
string hash = Convert.ToString(inputchar[i],2);
Console.WriteLine("{0}: {1}",inputchar[i],hash);

}
Console.ReadKey();
}
}
}
//一下是结果
input:abc
a: 1100001
b: 1100010
c: 1100011