Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c²Ù×÷·­×ª×Ö·û´®


#include<stdio.h>
#include<malloc.h>
#include<string.h>
/*
* ·­×ª
*/
char *mystrrev(char *arr)
{
if (!arr)
{
return NULL;
}
char *temp = arr;
char t;
int leng = strlen(arr) + 1;
int l = (int)(leng / 2);
int i = 0;
while (l--)
{
t = arr[i];
arr[i] = arr[leng - 2];
arr[leng - 2] = t;
i++;
leng--;
}
return temp;
}
/*
*½ØÈ¡µ¥¸ö´Ê»ã
*/
char *myrev(char *string)
{
if (!string)
{
return NULL;
}
char *temp1 = (char *)malloc(strlen(string) + 1);
char *temp2 = (char *)malloc(strlen(string) + 1);
char *temp3 = NULL;
*temp2 = '\0';
int i = 0;
for (int j=strlen(string); j>=0; --j)
{
temp1[i] = *string;
if (temp1[i] == ' ' || *(string) == '\0')
{
if (!temp3)
{
free(temp3);
temp3 = NULL;
}
temp3 = (char *)malloc(i);
temp1[i] = '\0';
i = 0;
strcpy(temp3, temp1);
strcat(temp2, mystrrev(temp3));
strcat(temp2, " ");
i = -1;
}
i++;
string++;
}
if (!temp1)
{
free(temp1);
temp1 = NULL;
}
if (!temp3)
{
free(temp3);
temp3 = NULL;
}
return temp2;
}
int main(int argc, char *argv[])
{
char *src = "Today is a good day";
char *s = "abcd_*__abcd";
char *temp = myrev(src);
char *temp1 = myrev(s);
printf("%s\n", temp);
printf("%s\n", temp1);
return 0;
}
½á¹û£º
yadoT si a doog yad
dcba__*_dcba


Ïà¹ØÎĵµ£º

qt4ÖÐÈçºÎµ÷ÓÃCº¯Êý£¨linuxÏ£©

qtĬÈϵıà³ÌÓïÑÔΪC++ÓïÑÔ¡£Èç¹ûÄãÓÃqt±àÒë.cÎļþ£¬»á³öÏÖÕÒ²»µ½CÓïÑÔµÄĬÈÏÍ·ÎļþµÈ´íÎó£¨È磺stdio.hµÈ£©¡£qtÖв»Ö§³Ö
extern "C"{}µÄÕâÖÖд·¨£¬ÎÒÇ°¼¸ÌìÓÐÒ»¸öC³ÌÐòÐèÒªÒÆÖ²µ½QtµÄ¹¤³ÌÖУ¬±¾Ï£ÍûÖ±½Óextern "C"¾ÍokÁË£¬µ«·¢ÏÖqt4¾ÓÈ»²»Ö§³ÖÕâÖÖд·¨¡£ÎҵijÌÐòÖÐÓõ½Á˺ü¸¸ölinuxϵͳͷÎļþ£¬ÊÇÏò´®¿Ú·¢Ö¸ÁîÖ®ÀàµÄ³ÌÐò ......

mysql C±à³Ì£¨Ò»£©mysql´íÎóÂ룬¹ØÓÚmysql_errno

¼ÙÉèÎÒÃÇʹÓÃmysql_real_queryÖ´ÐÐÁËÒ»ÌõsqlÓï¾äÖ®ºó£¬·µ»ØֵΪ·Ç0Öµ£¬´ó¼Ò¶¼ÖªµÀÕâÊÇÕâÌõÓï¾äÖ´Ðгö´í£¬µ«ÊÇÎÒÃÇÏë
Á˽âµØ¸üÏêϸµãµÄ»°£¬¾¿¾¹ÊÇʲôԭÒòµ¼ÖÂÁËÕâ¸ö´íÎóÄØ£¿Õâʱºò¾ÍµÃÓÃÉÏmysqlÌṩµÄÁíÍâÒ»¸öAPI£ºmysql_errno¡£
mysql_errno»áÌṩ×î½üÒ»´Îµ÷ÓõÄC API³ö´íµÄÐÅÏ¢£¨²»¼ûµÃÿ¸öAPI¶¼»á¶ÔÕâ¸öerrno½øÐÐÉèÖ ......

C/C++Ê¥Õ½£¨Èý£©

¹Ø¼üµÄʱ¿Ì - MFC Or Not
ÔÚSymantec C/C++ºÍWatcom C/C++Öð½¥µØÕ¾ÎÈÁ˽Ų½Ö®ºó£¬ËÄ´ó±àÒëÆ÷¾öÕ½µÄʱ¿ÌÒ²Ö𽥱ƽüÁË¡£ÔÚ1994ÄêδµÄ¾öս֮ǰ£¬SymantecºÍWatcomͬʱÃæ¶ÔÁËÒ»¸ö·Ç³£ÑÏÀ÷µÄ¿¼Ñ飬ÄǾÍÊÇC/C++ FrameworkµÄÑ¡Ôñ¡£ËäÈ»SymantecºÍWatcom¶¼ÒÔ¸÷×ÔµÄÌØÉ«Õ¼µÃÁËÊг¡£¬²»¹ýÔÚµ±Ê±¶ÔÓÚÒ»¸öC/C++¿ª·¢¹¤¾ßÀ´Ëµ£¬×îÖØÒªµÄÒ ......

C/C++ Í·Îļþ ³£ÓÃÍ·Îļþ¹¦Äܲéѯ±í

#include <assert.h>¡¡¡¡¡¡¡¡//É趨²åÈëµã
#include <ctype.h>¡¡¡¡¡¡¡¡ //×Ö·û´¦Àí
#include <errno.h>¡¡¡¡¡¡¡¡ //¶¨Òå´íÎóÂë
#include <float.h>¡¡¡¡¡¡¡¡ //¸¡µãÊý´¦Àí
#include <fstream.h>¡¡¡¡¡¡ //ÎļþÊäÈ룯Êä³ö
#include  ......

VIM¿ª·¢C£¯C£«£«²å¼þcvimµÄ°²×°¼°Ê¹ÓÃ


ÀûÓÃc.vim²å¼þ£¬Äã¿ÉÒÔʵÏÖ
Ìí¼ÓÎļþÍ·
Ìí¼Ó×¢ÊÍ
²åÈëһЩ´úÂëƬ¶Î
Óï·¨¼ì²é
¶Áº¯ÊýÎĵµ
×¢ÊÍ´úÂë¿é
ÕâÒ»²å¼þµÄ×÷ÕßÊÇ Fritz Mehner, Ä¿±ê¾ÍÊÇ´òÔì³ÌÐòÔ±Á÷³©µÄ±à¼­»·¾³¡£

ÕâÒ»²å¼þ»¹ÄÜÍê³É:
Statement oriented editing of C / C++ programs
Speed up writing new code considerably.
Write code and ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ