СµÜÎÒ´ÓCתC++ÓиöÎÊÌâÇë½Ì´ó¼Ò - C/C++ / C++ ÓïÑÔ
C/C++ code:
#include <iostream>
using namespace std;
class Complex
{
private:
int real;
int image;
public:
Complex ()
{
real = 0;
image = 0;
}
Complex (int n,int i)
{
real = n;
image = i;
}
Complex operator + (Complex &c1,Complex &c2)
{
return (c1.real+c2.real,c1.image+c2.image);
}
void display ()
{
cout<<real<<':'<<image;
}
};
int main()
{
Complex c1(2,3),c2(3,4),c3;
c3 = c1 + c2;
c3.display();
return 0;
}
СµÜÎÒ´ÓCתC++£¬Ñ§µ½ÔËËã·ûÖØÔؾͳöÎÊÌâÁË£¬Çë´ó¼Ò°ïÎÒ¿´¿´
{{--
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......