C++ÖеÄStaticÓÐÁ½¸ö×÷Óá£
1¡¢ ¾²Ì¬¾Ö²¿±äÁ¿
¾²Ì¬¾Ö²¿±äÁ¿ÔÚº¯ÊýÄÚ¶¨Òå ËüµÄÉú´æÆÚΪÕû¸öÔ´³ÌÐò£¬µ«ÊÇÆä×÷ÓÃÓòÔڸú¯ÊýÄÚ£¬Ö»ÄÜÔÚ¶¨Òå¸Ã±äÁ¿µÄº¯ÊýÄÚʹÓøñäÁ¿¡£ ÔÊÐí¶Ô¹¹ÔìÀྲ̬¾Ö²¿Á¿¸³³õÖµ£¬Èôδ¸³ÒÔ³õÖµ£¬ÔòÓÉϵͳ×Ô¶¯¸³ÒÔ0Öµ¡£
void fun1()
{
static int i = 0;
cout << ++i << endl;
}
int main()
{
for(int i = 0; i < 5; i++)
{
fun1();
}
}
Output :
1
2
3
4
2¡¢¾²Ì¬È«¾Ö±äÁ¿
È«¾Ö±äÁ¿Ç°ÔÙ¼ÓÉÏstatic ¾Í³ÉÁ˾²Ì¬µÄÈ«¾Ö±äÁ¿¡£È«¾Ö±äÁ¿±¾Éí¾ÍÊǾ²Ì¬´æ´¢·½Ê½£¬ ¾²Ì¬È«¾Ö±äÁ¿µ±È»Ò²ÊǾ²Ì¬´æ´¢·½Ê½¡£È«¾Ö±äÁ¿×÷ÓÃÓòÊÇÕû¸öÔ´³ÌÐò£¬¶ø¾²Ì¬È«¾Ö±äÁ¿×÷ÓÃÓòÈ·ÊǸÃÎļþ¡£¾²Ì¬º¯ÊýÀàËÆ¡£
......
C++ÖеÄStaticÓÐÁ½¸ö×÷Óá£
1¡¢ ¾²Ì¬¾Ö²¿±äÁ¿
¾²Ì¬¾Ö²¿±äÁ¿ÔÚº¯ÊýÄÚ¶¨Òå ËüµÄÉú´æÆÚΪÕû¸öÔ´³ÌÐò£¬µ«ÊÇÆä×÷ÓÃÓòÔڸú¯ÊýÄÚ£¬Ö»ÄÜÔÚ¶¨Òå¸Ã±äÁ¿µÄº¯ÊýÄÚʹÓøñäÁ¿¡£ ÔÊÐí¶Ô¹¹ÔìÀྲ̬¾Ö²¿Á¿¸³³õÖµ£¬Èôδ¸³ÒÔ³õÖµ£¬ÔòÓÉϵͳ×Ô¶¯¸³ÒÔ0Öµ¡£
void fun1()
{
static int i = 0;
cout << ++i << endl;
}
int main()
{
for(int i = 0; i < 5; i++)
{
fun1();
}
}
Output :
1
2
3
4
2¡¢¾²Ì¬È«¾Ö±äÁ¿
È«¾Ö±äÁ¿Ç°ÔÙ¼ÓÉÏstatic ¾Í³ÉÁ˾²Ì¬µÄÈ«¾Ö±äÁ¿¡£È«¾Ö±äÁ¿±¾Éí¾ÍÊǾ²Ì¬´æ´¢·½Ê½£¬ ¾²Ì¬È«¾Ö±äÁ¿µ±È»Ò²ÊǾ²Ì¬´æ´¢·½Ê½¡£È«¾Ö±äÁ¿×÷ÓÃÓòÊÇÕû¸öÔ´³ÌÐò£¬¶ø¾²Ì¬È«¾Ö±äÁ¿×÷ÓÃÓòÈ·ÊǸÃÎļþ¡£¾²Ì¬º¯ÊýÀàËÆ¡£
......
linuxÏÂ×Ö·û±àÂëת»»
Ò»¡¢ÀûÓÃiconvº¯Êý×å½øÐбàÂëת»»
iconvº¯Êý×åµÄÍ·ÎļþÊÇiconv.h,ʹÓÃÇ°Ðè°üº¬Ö®¡£
#include <iconv.h>
iconvº¯Êý×åÓÐÈý¸öº¯Êý,ÔÐÍÈçÏÂ:
(1) iconv_t iconv_open(const char *tocode, const char *fromcode);
´Ëº¯Êý˵Ã÷½«Òª½øÐÐÄÄÁ½ÖÖ±àÂëµÄת»»,tocodeÊÇÄ¿±ê±àÂë,fromcodeÊÇÔ±àÂë,¸Ãº¯Êý·µ»ØÒ»¸öת»»¾ä±ú,¹©ÒÔÏÂÁ½¸öº¯ÊýʹÓá£
(2) size_t iconv(iconv_t cd,char **inbuf,size_t *inbytesleft,char **outbuf,size_t *outbytesleft);
´Ëº¯Êý´ÓinbufÖжÁÈ¡×Ö·û,ת»»ºóÊä³öµ½outbufÖÐ,inbytesleftÓÃÒԼǼ»¹Î´×ª»»µÄ×Ö·ûÊý,outbytesleftÓÃÒԼǼÊä³ö»º³åµÄÊ£Óà¿Õ¼ä£¬cdÊÇiconv_open·µ»ØµÄ¾ä±ú¡£ (3) int iconv_close(iconv_t cd);
´Ëº¯ÊýÓÃÓڹرÕת»»¾ä±ú,ÊÍ·Å×ÊÔ´¡£
Àý×Ó1: ÓÃCÓïÑÔʵÏÖµÄת»»Ê¾Àý³ÌÐò
/* f.c : ´úÂëת»»Ê¾ÀýC³ÌÐò */
#include <iconv.h>
#define OUTLEN 255
main()
{
char *in_utf8 = "æ£å?¨å??è£?";
char *in_gb2312 = "ÕýÔÚ°²×°";
char out[OUTLEN];
//unicodeÂëתΪgb2312Âë
rc = u2g(in_utf8,strlen(in_utf8),out,OUTLEN);
printf("unicode-->gb2312 out=%sn",out);
//gb2312ÂëתΪunicode ......
ÏȼòÒª½éÉÜÏÂddµÄ²ÎÊý£¬ºó±ßͨ¹ý¼¸¸öʵÀý½éÉÜddµÄÓ¦Ó㬲ο¼ÁËÆäËûÍøÓѵÄ×ÊÁÏ£¬ÔÚ´ËÒ»
²¢¸Ðл£¬Ë®Æ½ÓÐÏÞÎÄÖÐÓÐʲô´íÎóÇë´ó¼ÒÖ¸Õý¡£
dd ÊÇ Linux/UNIX ϵÄÒ»¸ö·Ç³£ÓÐÓõÄÃüÁ×÷ÓÃÊÇÓÃÖ¸¶¨´óСµÄ¿é¿½±´Ò»¸öÎļþ£¬²¢ÔÚ¿½±´
µÄͬʱ½øÐÐÖ¸¶¨µÄת»»¡£
1. ÃüÁî¼ò½é
dd µÄÖ÷ҪѡÏ
Ö¸¶¨Êý×ֵĵط½ÈôÒÔÏÂÁÐ×Ö·û½áβ³ËÒÔÏàÓ¦µÄÊý×Ö:
b=512, c=1, k=1024, w=2, xm=number m
if=file
ÊäÈëÎļþÃû£¬È±Ê¡Îª±ê×¼ÊäÈë¡£
of=file
Êä³öÎļþÃû£¬È±Ê¡Îª±ê×¼Êä³ö¡£
ibs=bytes
Ò»´Î¶ÁÈë bytes ¸ö×Ö½Ú(¼´Ò»¸ö¿é´óСΪ bytes ¸ö×Ö½Ú)¡£
obs=bytes
Ò»´Îд bytes ¸ö×Ö½Ú(¼´Ò»¸ö¿é´óСΪ bytes ¸ö×Ö½Ú)¡£
bs=bytes
ͬʱÉèÖöÁд¿éµÄ´óСΪ bytes £¬¿É´úÌæ ibs ºÍ obs ¡£
cbs=bytes
Ò»´Îת»» bytes ¸ö×Ö½Ú£¬¼´×ª»»»º³åÇø´óС¡£
skip=blocks
´ÓÊäÈëÎļþ¿ªÍ·Ìø¹ý blocks ¸ö¿éºóÔÙ¿ªÊ¼¸´ÖÆ¡£
seek=blocks
´ÓÊä³öÎļþ¿ªÍ·Ìø¹ý blocks ¸ö¿éºóÔÙ¿ªÊ¼¸´ÖÆ¡£(ͨ³£Ö»Óе±Êä³öÎļþÊÇ´ÅÅÌ»ò´Å´øʱ²ÅÓÐЧ)¡£
count=blocks
½ö¿½±´ blocks ¸ö¿é£¬¿é´óСµÈÓÚ ibs Ö¸¶¨µÄ×Ö½ÚÊý¡£
conv=conversion[,conversion...]
ÓÃÖ¸¶¨µÄ²ÎÊýת»»Îļþ¡£
ת»»²ÎÊý:
ascii ת»» EBCDIC Ϊ ASCII ......
½ÌÄãIIS6µÄPHP×î¼ÑÅäÖ÷½·¨
¡¡¡¡ËäÈ» LAMP ×éºÏºÜ²»´í£¬µ«ÊÇÈç¹ûÏëÒª¼ÜÉèһ̨ͬʱ֧³ÖPHP¡¢ASP¡¢ASP.NET¡¢JSP¡¢PerlµÄWebÐéÄâÖ÷»ú·þÎñÆ÷£¬»¹ÊÇÓà Windows 2003µÄIIS 6×îºÃ¡£ÍøÉÏÓкܶà½éÉÜÔÚIIS 6ÉÏÅäÖÃPHPµÄÎÄÕ£¬µ«ÊÇÄÇЩ·½·¨²»ÊÇÐÔÄܲ»ºÃ£¬¾ÍÊÇÉý¼¶Âé·³¡£ÏÂÃæµÄ·½·¨¿ÉÒÔÈÃÄãÔÚµÚÒ»´ÎÅäÖúúó£¬Äܹ»·Ç³£·½±ãµÄ½øÐÐÉý¼¶¡£
¡¡¡¡ÕâÀïËù˵µÄÉý¼¶£¬ÊÇÖ¸´Óij¸öphp4°æ±¾Éý¼¶µ½ÁíÒ»¸öphp4°æ±¾£¬»òÕß´Óij¸öphp5°æ±¾Éý¼¶µ½ÁíÒ»¸öphp5°æ±¾£¬¶ø²»ÊÇÖ¸´Óphp4Éý¼¶µ½php5¡£
¡¡¡¡×¼±¸£º
¡¡¡¡1¡¢Ò»Ì¨°²×°ºÃµÄ Windows 2003 ·þÎñÆ÷£¬²¢ÇÒÒѾ°²×°ÁË IIS 6¡£
¡¡¡¡2¡¢ÏÂÔØ windows °æµÄ PHP ¶þ½øÖÆѹËõ°ü
¡¡¡¡°²×°£º
¡¡¡¡½âѹËõ PHP ¶þ½øÖÆѹËõ°üµ½ C:\php Ŀ¼Ï£¨ÕâÀï¼ÙÉè C: ÅÌÊÇϵͳÅÌ£¬¼´°²×°ÁËWindows ϵͳµÄÅÌ£¬Èç¹ûϵͳÅÌÊÇ D: ÅÌ£¬Ôò½âѹËõµ½ D:\php Ŀ¼Ï£¬ÒÔ´ËÀàÍÆ£¬ÏÂͬ£©¡£
¡¡¡¡È»ºó´ò¿ª“ÎҵĵçÄÔ”->“ÊôÐÔ”->“¸ß¼¶”->“»·¾³± ......
ÔÚVisual Studio 2005Öд´½¨C³ÌÐòµÄ·½·¨Îª£º
1. File ->New Project -> Visual C++ -> Win32 -> Win32 Console Application,È»ºóÔÚÏÂÃæµÄNameÀ¸Ð´ÉÏProjectÃû³Æ,LocationÀ¸Ð´ÉÏÎļþµÄ´æ·Å·¾¶,µãOK°´Å¥½øÈëApplication Settings,ÔÚAddtional optionsÖÐÑ¡ÔñEmpty project,µãFinish°´Å¥Íê³É¹¤³ÌµÄ´´½¨¡£
2. ÔÚvisual studio ÊÓͼµÄÓÒÉϽǵÄSolution ExplorerÖУ¬ÔÚSource FilesÖд´½¨c³ÌÐò£¬stepΪ£ºÓÒ¼üµã»÷Source Files,ÔÚmenuÖÐÑ¡ÔñAdd-> New Item£¬Ñ¡ÔñC++ File£¬²¢ÔÚÏÂÃæµÄName´¦¼üÈëfirst.c£¬location´¦Ð´ÉϳÌÐòÃû³ÆºÍ³ÌÐòµÄλÖã¬ÕâÀïѡĬÈϼ´²½Ö裱´´½¨µÄ¹¤³ÌλÖ㬵ãAdd°´Å¥Íê³ÉÎļþÔÚProjectÖеÄÌí¼Ó¡£
3.³ÌÐòдºÃºó£¬ÏȱàÒëÎļþ£¨Build-> Compile»òctrl+F7£©£¬ÔÙÔËÐУ¨Debug -> Start Without Debugging»òctrl+F5£©£¬¾Í»á¿´µ½Ëùд³ÌÐòµÄÔËÐÐresult£®
¸½£º£±¸ö×î¼òµ¥µÄ£Ã³ÌÐò£¬hoho
first.c
/* ÔÚÆÁÄ»ÉÏÊä³ö×Ö·û´® */
#include <stdio.h>
main()
{
printf("Hello ......
/**
*̽¾¿Öµ´«µÝÓëÒýÓô«µÝ
* ¿´Á˺öà¹ØÓÚjavaÖµ´«µÝºÍÒýÓô«µÝµÄÎÄÕ£¬Éî¸ÐÃÔ»ó
* ËùÒÔ¾Í×Ô¼º¿´¿´´óϺÃǵÄ˼·£¬×Ô¼ºÓôúÂ붯ÊÖʵÑ飬
* ¸Ð¾õͦˬµÄ¡£
* @author javaħÈË
* 2009-07-20 ÏÂÎç
*/
public class Test {
// method1
public static void changValue1(int a, int b) {
int c = a;
a = b;
b = c;
}
// method2£¨´Ó½á¹ûÀ´¿´£ºÏÔ¶øÒ×¼û£ºÖµ´«µÝ£©
public static void print1() {
int x = 0;
int y = 1;
changValue1(x, y); // ´«µÝµÄÊÇÖµµÃcoapy£¬x,y×ÔÉíû±ä»¯¡£
System.out.println("x=" + x); // Êä³ö:x=0
System.out.println("y=" + y); // Êä³ö:y=1
}
/**
* ¸öÈË×ܽ᣺ÒÔÉÏ·½·¨Ã»ÓÐÍê³ÉÎÒÃǵÄÀíÏë¡£×Ðϸ·ÖÎöÈçÏ£¬¿´¿´ÄÚ´æÖеĴ洢·½Ê½£º
* method2·½·¨µÄÁ½¸ö³ÉÔ±±äÁ¿£º
* ±äÁ¿ ÄÚ´æ
* x--------->[Öµ0]
* y--------->[Öµ1]
* µ÷ÓÃ ......