C×Ö·û´®·´×ªËã·¨
Ò»¸öºÜ¼ò½àµÄËã·¨£º
void Reverse(char s[])
{
for(int i = 0, j = strlen(s) - 1; i < j; ++i, --j) {
char c = s[i];
s[i] = s[j];
s[j] = c;
}
}
#¹ØÓÚa, b½»»»ÆäËüËã·¨£º
a ^= b;
b ^= a;
a ^= b;
Ò»¸öÎåÖֽⷨµÄ°æ±¾£º
ת×Ô£ºhttp://www.cnblogs.com/Mainz/articles/1164602.html
ÕâÊÇÍøÂçÁ÷´«µÄMicrosoftµÄÃæÊÔÌâĿ֮һ£º“±àд·´×ª×Ö·û´®µÄ³ÌÐò£¬ÒªÇóÓÅ»¯ËÙ¶È¡¢ÓÅ»¯¿Õ¼ä”¡£ÒòΪ×î½üÒ»Ö±ºÜ¶à¹Ø×¢Ëã·¨·½ÃæµÄʵ¼ùºÍÑо¿£¬Òò´Ë¶ÔÕâ¸öÎÊÌâ½øÐÐÁËһЩ˼¿¼£¬¸ø³öÁË5ÖÖʵÏÖ·½·¨£¨ÓÐÁ½ÖֽⷨÏà¹ØÐԱȽϴ󣩡£
½â·¨Ò»£ºµÚÒ»´Î¿´µ½ÕâÌâÄ¿£¬Ïëµ½×î¼òµ¥¡¢×îÖ±¾õµÄ½â·¨¾ÍÊÇ£º±éÀú×Ö·û´®£¬½«µÚÒ»¸ö×Ö·ûºÍ×îºóÒ»¸ö½»»»£¬µÚ¶þ¸öºÍµ¹ÊýµÚ¶þ¸ö½»»»£¬ÒÀ´ÎÑ»·£¬¼´¿É£¬ÓÚÊÇÓÐÁ˵ÚÒ»¸ö½â·¨£º
char* strrev1(const char* str)
{
int len = strlen(str);
char* tmp = new char[len + 1];
strcpy(tmp,str);
for (int i = 0; i < len/2; ++i)
{
char c = tmp[i];
tmp[i] = tmp[len – i - 1];
tmp[len – i - 1] = c;
}
return tmp;
}
ÕâÀïÊÇͨ¹ýÊý×éµÄϱ귽ʽ·ÃÎÊ×Ö·û´®µÄ×Ö·û£¬Êµ¼ÊÉÏÓÃÖ¸ÕëÖ±½Ó²Ù×÷¼´¿É¡£½â·¨¶þÕýÊÇ»ùÓÚ´Ë£¬ÊµÏÖ´úÂëΪ£º
char* strrev2(const char* str)
{
char* tmp = new char[strlen(str) + 1];
strcpy(tmp,str);
char* ret = tmp;
char* p =
Ïà¹ØÎĵµ£º
GCC°²×°³É¹¦,ËùÐèÎļþÓÐ:
libf2c-3.3.2-1.i386.rpm
libstdc++-devel-3.3.2-1.i386.rpm
glibc-kernheaders-2.4-8.36.i386.rpm
glibc-headers-2.3.2-101.i386.rpm
glibc-devel-2.3.2-101.i386.rpm
gcc-objc-3.3.2-1.i386.rpm
binutils-2.14.90.0.6-3.i386.rpm
gcc-3.3.2-1.i386.rpm
gcc-c++-3.3.2-1.i386.rpm
autom ......
×÷ÕߣºÊ¯Í·
extern "C"°üº¬Ë«Öغ¬Ò壬ÆäÒ»£º±»ËüÐÞÊεÄÄ¿±êÊÇ“extern”µÄ£»Æä¶þ£º±»ËüÐÞÊεÄÄ¿±êÊÇ“C”µÄ¡£
1£©±»extern “C”ÏÞ¶¨µÄº¯Êý»ò±äÁ¿ÊÇexternÀàÐ͵ģ»
externÊÇC/C++ÓïÑÔÖбíÃ÷º¯ÊýºÍÈ«¾Ö±äÁ¿×÷Ó÷¶Î§£¨¿É¼ûÐÔ£©µÄ¹Ø¼ü×Ö£¬¸Ã¹Ø¼ü×Ö¸æËß±àÒëÆ÷£¬ÆäÉùÃ÷µÄº¯ ......
·¢ÏÖ¸öÈ«¾Ö±äÁ¿Óë¾Ö²¿±äÁ¿µÄÇø±ð:
[code=C/C++]
char** t;
main()
{
char c[1];
char** t1;
sprintf(c,"%d",t);
printf("t=%s---\n",c);
if(strcmp(c,"0")!=0)
&nbs ......
²¿·ÖÄÚÈÝÀ´×Ôhttp://www.programfan.com/article/2674.htmlÒÔ¼°http://www.programfan.com/article/showarticle.asp?id=2675
²¿·Ö·ÒëÀ´×ÔTUM skript£¨c programmieren);
1.printf()£º
ǧÍò²»ÒªÒÅÍüÔÚprintf()µÄ×îºóÌí¼ÓNewLine"\n"¡£ÒòΪÔÚcµÄ¿âÖÐͨ³£ÓÐÐлº´æ»úÖÆ£¬Õâ¸öÒâζ×ÅÖ»Óе±Ò»ÐеÄÊäÈëͨ¹ý"\n"½áÊøÖ®Ç°£¬ÐеÄÊ ......
×ÖËÑË÷¾ÍËÑË÷Ò»¸öÊýÖоßÓÐÄ³Ð©ÌØÕ÷µÄλ¡£ÊµÏÖÈçÏ£º
/* wsearch.c£º×ÖËÑË÷ */
/* ´Ó×ó±ßѰÕÒµÚÒ»¸ö0×Ö½Ú£ºµÚ0(1,2,3)¸ö×Ö½ÚÊÇ0ʱ£¬·µ»Ø0(1,2,3)£¬·ñÔò·µ»Ø4 */
int zbytel(unsigned x){
if((x>>24)==0) return 0;
else if((x & 0x00ff0000)==0) return 1;
else if((x & 0x0000ff00)==0) r ......