设为首页 加入收藏

TOP

标准C++实现字符串类CString(三)
2014-11-24 03:17:21 来源: 作者: 【 】 浏览:7
Tags:标准 实现 字符串 CString
(s1.Compare(s2.GetData()) != 0);
}
bool operator!=(const CString& s1, const char* s2)
{
return (s1.Compare(s2) != 0);
}
bool operator!=(const char* s1, const CString& s2)
{
return (s2.Compare(s1) != 0);
}

bool operator>(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) > 0);
}
bool operator>(const CString& s1, const char* s2)
{
return (s1.Compare(s2) > 0);
}
bool operator>(const char* s1, const CString& s2)
{
return (s2.Compare(s1) < 0);
}

bool operator<(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) < 0);
}
bool operator<(const CString& s1, const char* s2)
{
return (s1.Compare(s2) < 0);
}
bool operator<(const char* s1, const CString& s2)
{
return (s2.Compare(s1) > 0);
}

bool operator>=(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) >= 0);
}
bool operator>=(const CString& s1, const char* s2)
{
return (s1.Compare(s2) >= 0);
}
bool operator>=(const char* s1, const CString& s2)
{
return (s2.Compare(s1) <= 0);
}

bool operator<=(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) <= 0);
}
bool operator<=(const CString& s1, const char* s2)
{
return (s1.Compare(s2) <= 0);
}
bool operator<=(const char* s1, const CString& s2)
{
return (s2.Compare(s1) >= 0);
}


首页 上一页 1 2 3 4 5 6 下一页 尾页 3/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C++面试题-链表栈二叉树数据结构 下一篇单独编译Android源代码中的模块

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C语言中如何将结构体 (2025-12-24 22:20:09)
·纯C语言结构体成员变 (2025-12-24 22:20:06)
·C语言中,指针函数和 (2025-12-24 22:20:03)
·哈希表 - 菜鸟教程 (2025-12-24 20:18:55)
·MySQL存储引擎InnoDB (2025-12-24 20:18:53)