linuxÄÚÁª»ã±àÖÐÊý×éµÄÑ°Ö·£¿ - C/C++ / C++ ÓïÑÔ
×î½üÏëÁ˽âÏÂÄÚÁª»ã±à£¬ÏëÒªÓÃÀ´²Ù×÷ÏÂÊý×éµÄʱºòÓöµ½Ð©À§ÄÑ¡£
ÎÒÁ˽⵽µÄһЩ·½·¨£º
C/C++ code:
int main()
{
//ÕâÖÖ·½·¨¿ÉÒÔµ¥¶À²Ù×÷Êý×éÖеÄÒ»¸ö
int a[10];
__asm__("movl $10, %0":"=m"(a[1]):);
//¶¯Ì¬ÉêÇëµÄ¿ÉÒÔÕâÑù²Ù×÷
int *b = (int*)malloc(10*sizeof(int));
__asm__("movl %0, %%eax;movl $10, 1(%%eax)":"=m"(b):);
}
ÎÊÌâÊÇÔõô¶Ô"int a[10];"½øÐÐÑ°Ö·ÄØ£¨±ÈÈçÒªÏë¶ÔÊý×éÖÐÿ¸öÖµ¸³Öµ£¬¿ÉÒÔÏñ¶Ô"int *b"Ò»Ñù²Ù×÷£©¡£ÊÔÁ˺ö෽·¨¶¼²»¹ÜÓã¬ÍøÉÏÒ²ËѲ»µ½Êý×éÏà¹ØµÄÀý×Ó£¬Ï£ÍûÖªµÀ·½·¨µÄÈ˸æËßСµÜÏ¡£
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
ÈçÌ⣬ÔÚWINDOWSµ×ϵÄCODE»á£¬µ«ÔÚLINUXϲ»ÖªµÀÈçºÎʵÏÖ£¬JSµÄ´úÂëÓ¦¸ÃÊDz»Ò»ÑùµÄ¡£ Çó½Ì¡£
·Ö²»¹»ÔÙ¼Ó¡£
http://topic.csdn.net/u/20100113/08/17ba1e71-4c33-43f6-91a5-0e031c86e5ed.html
linux ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......