| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 367 人关注过本帖
标题:关于一些C的题分享给大家看看大家能不能作出来
只看楼主 加入收藏
wxyljp
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-3-23
收藏
 问题点数:0 回复次数:1 
关于一些C的题分享给大家看看大家能不能作出来

6. Please write a string class, its Construction and Destruction function, and then override those operators, + , =, == (8 ‘)
There is the string class header, please finished the string.cpp files, and then write a simple application to test the string class.
#pragma once
class CString
{
protected:
LPTSTR m_pBuffer;
public:
// Construction
CString(LPCTSTR pcszValue = TEXT(""));
//Destruction
~CString();
// = operator
const CString& operator =(LPCTSTR pcwszValue);
const CString& operator =(const CString& rSrc);

// == operator
BOOL operator == (LPCTSTR pcszValue) const;
BOOL operator == (const CString& rValue) const;
friend BOOL operator == (LPCTSTR pcwszValue, const CString& rValue);

// += operator
const CString& operator += (LPCTSTR rSrc);
const CString& operator += (const CString& rSrc);

// + operator
const CString& operator + (LPCTSTR pszSrc);
const CString& operator + (const CString& rSrc);
friend const CString& operator + (LPCTSTR pszSrc,const CString& rSrc);
private:
DWORD m_dwLength;
DWORD GetLength() const { return m_dwLength; }
};

7. Write a function to check if a word is in a dictionary, if the word exist in the dictionary, output “We found the word!”, else give the similar words. (10 ‘)

There have two rules for the “Similar words”
a) One letters less than the original words, and others letters are same.
b) One letters more than the original words, and others letters are same.
For Example:
The dictionary is [aback, abaft, abaisse, abbe, can, an, out, get,g, gtc,]

If we search “abaft”, the search result is “We found the word!”
If we search “gt”, the search result is “which word you try to find? get, g or gtc.”
If we search “notebook”, the search result is “notebook no found!”

搜索更多相关主题的帖子: 分享 
2007-03-23 21:12
pinglideyu
Rank: 3Rank: 3
来 自:武汉工程大学
等 级:论坛游侠
威 望:1
帖 子:735
专家分:140
注 册:2007-1-7
收藏
得分:0 
这是C++中关于符号的重载吧?
这个还真的有点忘了。

~~我的明天我知道~~
2007-03-23 21:15
快速回复:关于一些C的题分享给大家看看大家能不能作出来
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020799 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved