һλͬѧÕûÀíµÄ³£¼û±ÊÊÔ/ÃæÊÔÌâÄ¿£¬´ð°¸½ö¹©²Î¿¼£¬²»´ú±í±¾È˹۵㡣
Õâ¸ö¶«Î÷ÓÐЩ²Î¿¼¼ÛÖµ,ºÍͬѧÌÖÂÛһϷ¢ÏÖ»¹ÊÇÓÐЩ´íÎó,
1£®ÒÑÖªstrcpyº¯ÊýµÄÔÐÍÊÇ£º
char * strcpy(char * strDest,const char * strSrc);
1.²»µ÷Óÿ⺯Êý£¬ÊµÏÖstrcpyº¯Êý¡£
2.½âÊÍΪʲôҪ·µ»Øchar *¡£
½â˵£º
1.strcpyµÄʵÏÖ´úÂë
char * strcpy(char * strDest,const char * strSrc)
{
if ((strDest==NULL)||(strSrc==NULL)) //[1]
throw "Invalid argument(s)"; //[2]
char * strDestCopy=strDest; //[3]
while ((*strDest++=*strSrc++)!='\0'); //[4]
return strDestCopy;
}
´íÎóµÄ×ö·¨£º
[1]
(A)²»¼ì²éÖ¸ÕëµÄÓÐЧÐÔ£¬ËµÃ÷´ðÌâÕß²»×¢ÖØ´úÂëµÄ½¡×³ÐÔ¡£
(B)¼ì²éÖ¸ÕëµÄÓÐЧÐÔʱʹÓÃ((!strDest)||(!strSrc))»ò(!(strDest&&strSrc))£¬ËµÃ÷´ðÌâÕß¶ÔCÓïÑÔÖÐÀàÐ͵ÄÒþʽת»»Ã»ÓÐÉî¿ÌÈÏʶ¡£ÔÚ±¾ÀýÖÐchar *ת»»Îªbool¼´ÊÇÀàÐÍÒþʽת»»£¬ÕâÖÖ¹¦ÄÜËäÈ»Áé»î£¬µ«¸ü¶àµÄÊǵ¼Ö³ö´í¸ÅÂÊÔö´óºÍά»¤³É±¾Éý¸ß¡£ËùÒÔC++רÃÅÔö¼ÓÁËbool¡¢true¡¢falseÈý¸ö¹Ø¼ü×ÖÒÔÌṩ¸ü°²È«µÄÌõ¼þ±í´ïʽ¡£
(C)¼ì²éÖ¸ÕëµÄÓÐЧÐÔʱʹÓÃ((strDest==0)||(strSrc==0))£¬ËµÃ÷´ðÌâÕß²»ÖªµÀʹÓó£Á¿µÄºÃ´¦¡£Ö±½ÓʹÓÃ×Ö ......
һλͬѧÕûÀíµÄ³£¼û±ÊÊÔ/ÃæÊÔÌâÄ¿£¬´ð°¸½ö¹©²Î¿¼£¬²»´ú±í±¾È˹۵㡣
Õâ¸ö¶«Î÷ÓÐЩ²Î¿¼¼ÛÖµ,ºÍͬѧÌÖÂÛһϷ¢ÏÖ»¹ÊÇÓÐЩ´íÎó,
1£®ÒÑÖªstrcpyº¯ÊýµÄÔÐÍÊÇ£º
char * strcpy(char * strDest,const char * strSrc);
1.²»µ÷Óÿ⺯Êý£¬ÊµÏÖstrcpyº¯Êý¡£
2.½âÊÍΪʲôҪ·µ»Øchar *¡£
½â˵£º
1.strcpyµÄʵÏÖ´úÂë
char * strcpy(char * strDest,const char * strSrc)
{
if ((strDest==NULL)||(strSrc==NULL)) //[1]
throw "Invalid argument(s)"; //[2]
char * strDestCopy=strDest; //[3]
while ((*strDest++=*strSrc++)!='\0'); //[4]
return strDestCopy;
}
´íÎóµÄ×ö·¨£º
[1]
(A)²»¼ì²éÖ¸ÕëµÄÓÐЧÐÔ£¬ËµÃ÷´ðÌâÕß²»×¢ÖØ´úÂëµÄ½¡×³ÐÔ¡£
(B)¼ì²éÖ¸ÕëµÄÓÐЧÐÔʱʹÓÃ((!strDest)||(!strSrc))»ò(!(strDest&&strSrc))£¬ËµÃ÷´ðÌâÕß¶ÔCÓïÑÔÖÐÀàÐ͵ÄÒþʽת»»Ã»ÓÐÉî¿ÌÈÏʶ¡£ÔÚ±¾ÀýÖÐchar *ת»»Îªbool¼´ÊÇÀàÐÍÒþʽת»»£¬ÕâÖÖ¹¦ÄÜËäÈ»Áé»î£¬µ«¸ü¶àµÄÊǵ¼Ö³ö´í¸ÅÂÊÔö´óºÍά»¤³É±¾Éý¸ß¡£ËùÒÔC++רÃÅÔö¼ÓÁËbool¡¢true¡¢falseÈý¸ö¹Ø¼ü×ÖÒÔÌṩ¸ü°²È«µÄÌõ¼þ±í´ïʽ¡£
(C)¼ì²éÖ¸ÕëµÄÓÐЧÐÔʱʹÓÃ((strDest==0)||(strSrc==0))£¬ËµÃ÷´ðÌâÕß²»ÖªµÀʹÓó£Á¿µÄºÃ´¦¡£Ö±½ÓʹÓÃ×Ö ......
ΪÁ˱àд¸ß¾«¶È¸¡µãÊýµÄÔËË㣬±à³ÌÈËÔ±ÐèÒª¿ØÖƸ¡µãÊý»·¾³µÄ¸÷¸ö·½Ã棺½á¹ûÈçºÎÉáÈ룬¸¡µãÊý±í´ïʽÈçºÎ¼ò»¯Óë±ä»»£¬ÈçºÎ´¦Àí¸¡µãÊýÒì³££¨ÈçÏÂÒçÖ®ÀàµÄ¸¡µãÊýÒì³£ÊǺöÂÔ»¹ÊDzúÉú´íÎ󣩣¬µÈµÈ¡£C99ÒýÈëÁËfenv.hÀ´¿ØÖƸ¡µãÊý»·¾³¡£
1¡¢fenv.h£º
¶¨ÒåÁ˸¡µãÊý»·¾³¿ØÖƺ¯Êý¡¢Òì³£¿ØÖƺ¯Êý¡¢ÉáÈ뷽ʽ¿ØÖƺ¯Êý¡¢¸¡µãÊýÒì³£ÂëºÍÉáÈ뷽ʽµÈ¡£×¢Ò⸡µãÊý»·¾³µÄʵÏÖÊÇÒÀÀµÓÚÌåϵ½á¹¹µÄ£¬ÒòΪ²»Í¬µÄÌåϵ½á¹¹Óв»Í¬µÄ¸¡µãÊýÖ¸Á¡£ÒÀÀµÓÚÌåϵ½á¹¹µÄ¶¨Òå·ÅÔÚbits/fenv.hÖУ¬ÕâÀïÊÇx86Ìåϵ½á¹¹µÄ°æ±¾(LinuxÏ£©¡£
±ê׼ͷÎļþfenv.hÄÚÈÝÈçÏ£º
/* ISO C99 7.6: ¸¡µãÊý»·¾³ <fenv.h> */
#ifndef _FENV_H
#define _FENV_H 1
#include <features.h>
/* »ñÈ¡ÒÀÀµÓÚÌåϵ½á¹¹µÄ¶¨Òå¡£Ó¦¸ÃÒªÓÐÏÂÃæÕâЩ¶¨Ò壺
fenv_t ±íʾ¸¡µãÊý»·¾³µÄÀàÐÍ
FE_DFL_ENV fenv_t *Ö¸ÕëÀàÐ͵ÄÖµ£¬±íʾ¸¡µãÊý»·¾³µÄȱʡֵ£¨ÓÃÓÚÐèÒªfenv_t²ÎÊýµÄº¯ÊýÖУ©
fexcept_t ±íʾ¸¡µãÊýÒì³£±êÖ¾£¨Õâ¸ö±êÖ¾±£´æÁ˸¡µãÊýµÄ״̬£©µÄÀàÐÍ
ÏÂÃæµÄºê±»¶¨Ò壬µ±ÇÒ½öµ±ÊµÏÖÖ§³ÖÕâЩºêʱ£º
FE_INEXACT ²»¾«È·µÄ½á¹û
FE_DIV ......
ºÍÔÚIDEÖбàÒëÏà±È£¬ÃüÁîÐÐģʽ±àÒëËٶȸü¿ì£¬²¢¿ÉÒÔ±ÜÃâ±»IDE²úÉúµÄһЩ¸½¼ÓÐÅÏ¢Ëù¸ÉÈÅ¡£±¾ÎĽ«½éÉÜ΢ÈíC/C++±àÒëÆ÷ÃüÁîÐÐģʽÉ趨ºÍÓ÷¨¡£
1¡¢ÉèÖû·¾³±äÁ¿£º
PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin
INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include
LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib
Èç¹ûÌáʾÕÒ²»µ½mspdb80.dllÎļþ£¬Ôò´ÓC:\Program Files\Microsoft Visual Studio 8\Common7\IDEÏ¿½±´“msobj80.dll,mspdb80.dll,mspdbcore.dll,mspdbsrv.exe”ÕâËĸöÎļþµ½C:\Program Files\Microsoft Visual Studio 8\VC\binϼ´¿É¡£
2¡¢ÃüÁîÑ¡Ï
1) /C:ÔÚÔ¤´¦ÀíÊä³öÖб£Áô×¢ÊÍÓï¾ä
2) /c:Ö»±àÒ룬²»Á¬½Ó£¬Ï൱ÓÚÔÚ"Build"²Ëµ¥ÏÂÑ¡ÔñÁË"Compile"
3) /D:¶¨Òå³£Á¿ºÍºê£¬ÓëÔ´³ÌÐòÀïµÄ#define ÓÐÏàͬЧ¹û
4) /E:Ô¤´¦ÀíC¡¢C£«£«Ô´Îļþ£¬½«Ô´ÎļþÖÐËùÓеÄÔ¤±àÒëÖ¸Áî¼°ºêÕ¹¿ª£¬½«×¢ÊÍÈ¥µô£¬È»ºó½«Ô¤´¦ÀíÆ÷µÄÊä³ö¿½±´ÖÁ±ê×¼Êä³öÉ豸Êä³ö£¬² ......
ºÍÔÚIDEÖбàÒëÏà±È£¬ÃüÁîÐÐģʽ±àÒëËٶȸü¿ì£¬²¢¿ÉÒÔ±ÜÃâ±»IDE²úÉúµÄһЩ¸½¼ÓÐÅÏ¢Ëù¸ÉÈÅ¡£±¾ÎĽ«½éÉÜ΢ÈíC/C++±àÒëÆ÷ÃüÁîÐÐģʽÉ趨ºÍÓ÷¨¡£
1¡¢ÉèÖû·¾³±äÁ¿£º
PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin
INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include
LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib
Èç¹ûÌáʾÕÒ²»µ½mspdb80.dllÎļþ£¬Ôò´ÓC:\Program Files\Microsoft Visual Studio 8\Common7\IDEÏ¿½±´“msobj80.dll,mspdb80.dll,mspdbcore.dll,mspdbsrv.exe”ÕâËĸöÎļþµ½C:\Program Files\Microsoft Visual Studio 8\VC\binϼ´¿É¡£
2¡¢ÃüÁîÑ¡Ï
1) /C:ÔÚÔ¤´¦ÀíÊä³öÖб£Áô×¢ÊÍÓï¾ä
2) /c:Ö»±àÒ룬²»Á¬½Ó£¬Ï൱ÓÚÔÚ"Build"²Ëµ¥ÏÂÑ¡ÔñÁË"Compile"
3) /D:¶¨Òå³£Á¿ºÍºê£¬ÓëÔ´³ÌÐòÀïµÄ#define ÓÐÏàͬЧ¹û
4) /E:Ô¤´¦ÀíC¡¢C£«£«Ô´Îļþ£¬½«Ô´ÎļþÖÐËùÓеÄÔ¤±àÒëÖ¸Áî¼°ºêÕ¹¿ª£¬½«×¢ÊÍÈ¥µô£¬È»ºó½«Ô¤´¦ÀíÆ÷µÄÊä³ö¿½±´ÖÁ±ê×¼Êä³öÉ豸Êä³ö£¬² ......
linux
ÏÂÓÃCʵÏÖ‘CAT’µÄ¹¦ÄÜ
#include<stdio.h>
int main(int argc,char *argv[]){
FILE *file;
char buf[1024],name[20];
int n;
if(argc != 2){
printf("wrong argument\n");
return 1;
}
file=fopen(argv[1],"r");
if(file==NULL){
printf("Cant't open!\n");
return 1;
}
else{
while((n=fread(buf,sizeof(char),1024,file))>0){
printf("%s",buf);
}
}
return 0;
}
......
linux
ÏÂÓÃCʵÏÖ‘CAT’µÄ¹¦ÄÜ
#include<stdio.h>
int main(int argc,char *argv[]){
FILE *file;
char buf[1024],name[20];
int n;
if(argc != 2){
printf("wrong argument\n");
return 1;
}
file=fopen(argv[1],"r");
if(file==NULL){
printf("Cant't open!\n");
return 1;
}
else{
while((n=fread(buf,sizeof(char),1024,file))>0){
printf("%s",buf);
}
}
return 0;
}
......
public void Gridview_BindNoRecords(GridView gridView, DataTable dt) // gridView£¬°ó¶¨Êý¾ÝÔ´DT
{
int a = dt.Rows.Count;
if (dt.Rows.Count == 0)
{
dt.Rows.Add(dt.NewRow());
gridView.DataSource = dt;
gridView.DataBind();
int columnCount = gridView.Rows[0].Cells.Count;
gridView.Rows[0].Cells.Clear();
gridView.Rows[0].Cells.Add(new TableCell());
gridView.Rows[0].C ......
IIS5µÄHTTP 500ÄÚ²¿·þÎñÆ÷´íÎóÊÇÎÒÃǾ³£Åöµ½µÄ´íÎóÖ®Ò»£¬ËüµÄÖ÷Òª´íÎó±íÏÖ¾ÍÊÇASP³ÌÐò²»ÄÜä¯ÀÀµ«HTM¾²Ì¬ÍøÒ³²»ÊÜÓ°Ïì¡£ÁíÍâµ±´íÎó·¢Éúʱ£¬ÏµÍ³Ê¼þÈÕÖ¾ºÍ°²È«Ê¼þÈÕÖ¾¶¼»áÓÐÏàÓ¦µÄ¼Ç¼¡£
¡¡¡¡Ò»¡¢·¢ÉúÔµÓÉ£º
¡¡¡¡ÓÉÓû§·½Ã汨¸æ¹ÊÕÏ£¬ËµÊǸÃÕ¾µãÉÏËùÓеÄASPÒ³Ãæ¾ù²»ÄÜ·ÃÎÊ¡£
¡¡¡¡±¾µØÔËÐÐaspÎļþ£¬IEÌáʾ£º
¡¡¡¡HTTP 500 - ÄÚ²¿·þÎñÆ÷´íÎó
¡¡¡¡Server Application Error
¡¡¡¡The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance.
¡¡¡¡²é¿´ÈÕÖ¾Îļþ£º
¡¡¡¡ÏµÍ³ÈÕÖ¾¾ßÌåÃèÊöÈçÏ£º
¡¡¡¡DCOM ´íÎó ÎÞ 10010 NT AUTHORITY\SYSTEM Myserver ·þÎñÆ÷ {3D14228D-FBE1-11D0-995D-00C04FD919C1} ûÓÐÔÚÏÞ¶¨µÄʱ¼äÄÚÓà DCOM ×¢²á¡£
¡¡¡¡¶þ¡¢ÔÒò·ÖÎö
¡¡¡¡Ôø¾É¾³ý¹ýSA£¬SAMÎļþÊDZ£´æÓû§ÃÜÂëµÄÊý¾Ý¿âÎļþ£¬É¾³ýºó£¬ËùÓеÄÓû§ÐÅÏ¢¾Í»á¶ªÊ§£¬¶øÏàÓ¦µÄ×éÐÅÏ¢Ò²»áËæÖ®¶ªÊ§£¬ËäÈ»ÖØÐµÇ¼¹ýϵͳ£¬ÏµÍ³ÒÑ¾ÖØÐ½¨Á¢ÁËSAMÎļþ£¬Ò²ÖØÐ°²×°ÁËIIS£¬IWAMÕʺÅÒ²ÒÑ¾ÖØÐ½¨Á¢£¬µ«ÊÇ£¬ÔÓû§×éÖеÄÌØÊâÐÅÏ¢ ......