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

C rule

Àý) Σ険¤Ê¥³ー¥Ç¥£¥ó¥°
1                char cStr[256];
2                ZeroMemory(cStr, sizeof(cStr));
3                strcpy(cStr, src);  ←  src¤Î¥µ¥¤¥º¤¬256¥Ð¥¤¥È¤ò³¬¤¨¤Æ¤¤¤¿場ºÏ¥ªー¥Ðー¥Õ¥íー£¡
 
ÐÞÕý)
1                char cStr[256];
2                ZeroMemory(cStr,0, sizeof(cStr));
3                strncpy(cStr, src, sizeof(cStr)-1); 
 
Σ険¤Ê関Êý
´úÌæ関Êý
gets
fgets
strcat
strncat
strcpy
strncpy
sprintf
snprintf
vsprintf
vsnprintf
 
Σ険¤ÊÀý)
#include <stdlib.h>
main (int argc, char* argv[]) {
printf(argv[1]);
}
 
ÐÞÕýÀý)
#include <stdlib.h>
main (int argc, char* argv[]) {
  printf("%s",argv[1]);
}
 
Σ険¤Ê関Êý
printf
sprintf
fprintf
vsprintf
snprintf
vsnprintf
 
¡ù書ʽÎÄ×ÖÁФδàÈõÐÔ
書ʽÎÄ×ÖÁУ¨¥Õ¥©ー¥Þ¥Ã¥È¥¹¥È¥ê¥ó¥°£©¤È¤Ï¡¢printf関ÊýµÈ¤ÇʹÓ䵤ì¤ë書ʽ¤òÖ¸¶¨¤¹¤ëÎÄ×ÖÁÐ
¤Î¤³¤È¤Ç¤¢¤ë¡£¥ê¥¹¥È¤ÎÀý¤Ç¤Ï¡¢ÈëÁ¦¤µ¤ì¤¿ÎÄ×ÖÁФΤßÖ¸¶¨¤µ¤ì¤Æ¤ª¤ê¡¢書ʽÎÄ×ÖÁФ¬Ê¡ÂÔ¤µ¤ì¤¿
ÐΤǺô¤Ó³ö¤µ¤ì¤Æ¤¤¤ë¡£
 
¥ê¥¹¥È)
#include <stdlib.h>
main (int argc, char* argv[]) {
         printf(argv[1]);
}
 
ͨ³£¤ÎÎÄ×ÖÁФ¬ÈëÁ¦¤µ¤ì¤ë場ºÏ¤Ï問題¤Ê¤¤¤¬¡¢書ʽÎÄ×ÖÁФòº¬¤ó¤ÀÈëÁ¦¤òÓ뤨¤ë¤³¤È¤Ç¹¥撃¤¬¤Ç¤­¤ë¡£
printf関Êý¤Ç¤Ï¡¢書ʽÎÄ×ÖÁФ¬Ö¸¶¨¤µ¤ì¤ë¤È¡¢対応¤¹¤ë変Êý¤¬ÒýÊý¤ÇÓ뤨¤é¤ì¤Æ¤¤¤ë¤â¤Î¤È¤·¤Æ
動×÷¤¹¤ë¤¿¤á¡¢ÏÂ図¤Î¤è¤¦¤Ë²»Õý¤Ê動×÷¤È¤Ê


Ïà¹ØÎĵµ£º

JSTL ʹÓà c:forEach

ÔÚ Web Ó¦ÓóÌÐò»·¾³ÖУ¬µü´úÖ÷ÒªÓÃÓڷôæºÍÏÔʾÊý¾Ý¼¯£¬Í¨³£ÊÇÒÔÁбí»ò±íÖеÄһϵÁÐÐеÄÐÎʽÏÔʾ¡£ÊµÏÖµü´úÄÚÈݵÄÖ÷Òª JSTL ²Ù×÷ÊÇ <c:forEach>; ¶¨ÖƱê¼Ç¡£¸Ã±ê¼ÇÖ§³ÖÁ½ÖÖ²»Í¬ÑùʽµÄµü´ú£ºÕûÊý·¶Î§Éϵĵü´ú£¨ÀàËÆ Java ÓïÑ﵀ for Óï¾ä£©ºÍ¼¯ºÏÉϵĵü´ú£¨ÀàËÆ Java ÓïÑ﵀ Iterator ºÍ Enumeration Àࣩ¡£
½øÐÐÕûÊ ......

ÅжÏC?ÐÐ??¾³µÄ³ÌÐò

/*
**ÅжÏC?ÐÐ??¾³µÄ³ÌÐò
*/
/*
**¾²?³õʼ»¯
*/
int static_variable=5;
void
f()
{
 register int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
 register char *c1, *c2, *c3, *c4, *c5, *c6, *c7 , *c8, *c9, *c10;
 extern int a_very_long_name_to_sec_how_long_they_can_be;
 double ......

Ubuntu linuxϵͳÏ°²×°C kermit´®¿Ú¹¤¾ß

½â¾ö²½Ö裺
gylu@dell-desktop:~$ sudo apt-get install ckermit
ÏÔʾ°²×°¹ý³Ì
gylu@dell-desktop:~$gedit ~/.kermrc
ÊäÈëÏÂÃæÄÚÈݺ󱣴æ.kermrcÍ˳ö:
   set line            /dev/ttyS0
    set speed    & ......

linux³£ÓÃcº¯Êý ÎļþȨÏÞ¿ØÖÆƪ

access£¨ÅжÏÊÇ·ñ¾ßÓдæÈ¡ÎļþµÄȨÏÞ£©
¡¡¡¡Ïà¹Øº¯Êý  stat£¬open£¬chmod£¬chown£¬setuid£¬setgid
¡¡¡¡±íÍ·Îļþ  #include<unistd.h>
¡¡¡¡¶¨Ò庯Êý  int access(const char * pathname,int mode);
¡¡¡¡º¯Êý˵Ã÷  access()»á¼ì²éÊÇ·ñ¿ÉÒÔ¶Á/дijһÒÑ´æÔÚµÄÎļþ¡£²ÎÊýmodeÓм¸ÖÖÇé¿ö×éºÏ£¬R_OK ......

C/C++º¯Êý²ÎÊý,´«ÖµÓò´«Ö·µÄÇø±ð!!!

/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê5ÔÂ8ÈÕ, ÏÂÎç2:47
*/
#include <iostream>
using namespace std;
class A{
public:
A(){
cout << "Ö´Ðй¹Ô캯Êý´´½¨Ò»¸ö¶ÔÏó" << endl;
}
A(A&){
cout << "Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ