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

¹ØÓÚlinuxÓëwindows stl mapµÄÎÊÌâ

C/C++ code:
#include <map>
using namespace std;

template<typename K, typename T>
class a
{
public:
map<K,T> _map;
T find(K v)
{
map<K,T>::iterator iter;
iter = _map.find(v);
if(iter != _map.end())
return iter->second;
else
return (T)0;
}
};
int main()
{
a<int, unsigned int> b;
return 0;
}

ΪʲôÕâ¶Î´úÂëÔÚvc2005ÖпÉÒÔ±àÒëͨ¹ý£¬¶øÔÚlinux£¨red heat£©Ï²»ÄÜͨ¹ý£¿
ÄÇÊÇÒòΪintºÍunsigned intÔÚlinuxƽ̨ÏÂûÓÐÇø±ð¡£
Ä£°åµÄ¶þÒåÐÔ¡£Óë±àÒëÆ÷ʵÏÖÓйء£

È¥µôa <int, unsigned int> b;ÕâÐÐÒ²Ò»Ñù£¬ÓëÄ£°å²ÎÊýÎÞ¹Ø

test.cpp: In member function `T a <K, T>::find(K)':
test.cpp:11: error: expected `;' before "iter"
test.cpp:12: error: `iter' was not declared in this scope

red heatϱàÒ뱨Õâ¸ö´í

ßÀ£¬google Ä£°å²ÎÊýÒÀÀµÀàÐÍ¡£
typenameµÄ¹¦ÄÜûºÃºÃѧ°É¡£


¼ÓÉÏ typename.
ÈçÏ£º

#include <map>
using namespace std;

template <typename K, typename T>
class a
{
public:
    map <K,T> _map;
    T find(K v)
    {
        typename map <K,T>::iterator iter;


Ïà¹ØÎÊ´ð£º

Ë­Äܸø¸öLinuxÏÂдC/C++³ÌÐòµÄ½Ì³Ì£¿

¸ø¸öµØÖ·£¬»òÕß·¢µ½ÎÒÓÊÏäÒ²ÐÐ wrongagain98@163.com
×îºÃÊÇÊÓÆµµÄ£¬²»ÊÇÊÓÆµÆÕͨµÄÒ²ÐС£

Ö÷ÒªÊÇÁ½·½Ã棺
1.ÔõÑù±à¼­¡¢±àÒëºÍµ÷ÊÔ³ÌÐò¡£Ï£ÍûÄÜÒ»²½²½½²Çå³þ£¬ÈçºÎ°²×°¡¢ÈçºÎÅäÖõȡ£²»Òª¾Íֻ˵¾ä¡°¾ÍÓ ......

linux»·¾³ÏÂgethostbynameº¯ÊýÎÊÌâ - C/C++ / CÓïÑÔ

дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

ǶÈëʽLinuxËõ¼õÎÊÌâ

´ó¼ÒºÃ£¬±¾ÈËĿǰ¸Õ¸Õ½Ó´¥Linux¡£ÏÖÔÚ¹«Ë¾µÄÏîÄ¿ÐèÒªËõ¼õLinuxµÄKernelºÍAPP²¿·ÖµÄCode Size¡£Ä¿Ç°ÎÒÃÇʹÓõÄÊÇLinux2.6.22.15°æ±¾£¬Ó¦ÓÃÓÚADSL Modem£¨¼ÒÍ¥Íø¹Ø£©¡£

1.ÎÒÃDzúÆ·Ó¦ÓÃÊÇADSL Gateway£¬Kernel²¿ ......

linux °²×°xinetdµÄÎÊÌâ

ÒòΪ°²×°cvsÒªÓõ½xinetd·þÎñ£¬·¢ÏÖ»úÆ÷ÉÏûÓС£¡£¾Í´ÓÍøÉÏÏÂÔØÁ˸ö×°ÉÏ£¬
SQL code:
[root@localhost ~]# rpm -qa xinetd
[root@localhost ~]# rpm -qa telnet
telnet-0.17-38.el5
[root@localhost ~]#
¸ ......

php±àдִÐÐlinux shellÃüÁîµÄ´úÂë

ʹÓÃPHPµÄexecº¯Êýµ÷ÓÃlinuxµÄshellÃüÁÈçdateÈ¥ÐÞ¸Äʱ¼ä»òshutdownȥʵÏֹػú/ÖØÆô£¬µ«ÊÇ·µ»ØÖµ¶¼ÊÇʧ°ÜµÄ¡£¾­¹ý¶à´ÎÊÔÑ飬È϶¨ÊÇûÓÐȨÏÞµÄÎÊÌâ¡£
ËùÒÔ£¬Ð¡µÜÔÚ´ËÇë½Ì¸÷룬ÈçºÎ²ÅÄÜÉèÖÃȨÏÞ£¬µ÷ÓÃlinux shellà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ