C/C++ ÓëÔËËãºÍ»òÔËËãת»»´óСд
// & Óë,½«Ö¸¶¨Î»ÖÃÉèÖÃΪ0 | »ò,½«Ö¸¶¨Î»ÖÃÉèÖÃΪ1
//×¢: Ö»Õë¶Ô´¿×ÖĸµÄÇé¿ö
#include <stdio.h>
#include <string>
int main()
{
char str[6] = "xxing";
std::string str1 = "INGXX";
for(int i = 0; i < 5; i++)
{
str[i] &= 0xdf;// ת´óд 1101 1111
str1[i] |= 0x20;// תСд 0010 0000
}
printf("xxing:%s\nINGXX:%s\n", str, str1.c_str());
return 0;
}
Ïà¹ØÎĵµ£º
C/C++: Ê®Áù½øÖÆ×ª10½øÖÆÔ´Âë
ÊÕ²Ø
view plain
copy to clipboard
print
?
int
hex_char_value(
char
c)
{
if
(c >=
'0'
&& ......
ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØÒªÊ¹ÓÃÏ̳߳ØÁË¡£
ÏÂÃæÊÇLinuxϵͳÏÂÓÃCÓïÑÔ´´½¨µÄÒ»¸öÏ̳߳ء£Ï̳߳ػ ......
ÓÃÁËÈýÖÖ·½·¨...
#if 0
void StringTokenize(const std::string& strSrc, const std::string& strDelimit, std::vector<std::string>& vecSub)
{
if (strSrc.empty() || strDelimit.empty())
{
throw "tokenize: empty string\n";
......
1¡¢ÔÚCÎļþÖе÷ÓÃC++ÎļþÖж¨ÒåµÄÎļþ
Ö±½ÓµÄ·½·¨ÊÇÔÚC++ ÎļþµÄÍ·²¿Ìí¼ÓÈçÏ´úÂë¶Î£º
extern "C"
{
int API(int A);
}
2¡¢C++½Ó¿ÚµÄ·½·¨
ÔÚC++Öе÷ÓÃCµÄº¯Êý£¬ÔÚCÍ·ÎļþÖмÓÈëÈçÏ´úÂ룺
#ifdef __cplusplus // ¿ªÊ¼
exte ......