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

C/C++£¬Ê±¼ä£¬Ö¸ÕëµÄÒÉÎÊ£¬Ð»Ð»£¡ - C/C++ / C++ ÓïÑÔ

#include <iostream>
#include <time.h>

int main()
{
  using namespace std;

  time_t t1,t2;
  struct tm *p1,*p2;

  t1 = time(0);
  p1 = localtime(&t1);
  cout << p1 << "," << p2 << endl;

  t2 = t1 - 24*3600;
  p2 = localtime(&t2); //Õâ¾äΪʲô»á¸Ä±äp1µÄÖ¸Õ룿
  cout << p1 << "," << p2 << endl;
   
  cout << p1->tm_year+1900 << "-" << p1->tm_mon+1 << "-" << p1->tm_mday << endl;
  cout << p2->tm_year+1900 << "-" << p2->tm_mon+1 << "-" << p2->tm_mday << endl;
}

Ö´Ðнá¹û£º
0xd32300,0xbfe2ad08
0xd32300,0xd32300
2010-5-9
2010-5-9

ÎÒÏëÎÊһϣ¬ÎªÊ²Ã´°Ñp1Ö¸ÕëµÄµØÖ·¸Ä±äÁËÄØ£¿
p2 = localtime(&t2)ÔÚÕâ֮ǰûʹÓà ÊǸöÒ°Ö¸ÕëÖ¸ÏòµÄÊÇÈÎÒâµØÖ·
Ö´ÐÐÒÔºóP2µÃµ½localtimeµÄ·µ»ØÖµ

0xd32300,0xbfe2ad08
0xd32300,0xd32300
Ç°ÃæÄǸöÊÇp1°¡£¬²»ÊÇûÓиıäÂð£¿

p1µÄµØÖ·¸Ä±äÁËÂð

±§Ç¸£¬ÎÒÊÇÖ¸p2µÄÖ¸ÕëΪʲô»á¸Ä±äΪp1µÄÖ¸Õ룿

µÚÒ»¸öÖ¸ÕëÊÇû¾­¹ý³õʼ»¯¾ÍʹÓÃ.µÃ³öÀ´µÄÊÇÒ»¸ö"À¬»øÖµ".
vs2010ÉÏÔËÐеĽá¹û.½á¹û³öÀ´Ç°Ìáʾ´íÎó
00591410,CCCCCCCC
00591410,00591410
2010-5-11


Ïà¹ØÎÊ´ð£º

execlÔõôµ÷ÓÃjava³ÌÐò - C/C++ / CÓïÑÔ

ÈçÌ⣬C/C++ÖеÄexeclÔõôµ÷ÓÃдºÃµÄjava³ÌÐò£¬
execl("/opt/java1.5/bin/java","MyClass",NULL);
ÕâÑùµÄ²»ÐÐŶ¡£

²»»á.

ÔËÐÐjava³ÌÐò
ÕÒ¹¤¾ß²é¿´Ò»ÏÂÄǸö³ÌÐòµÄÃüÁîÐÐ

ËÑË÷Ï£ºjni ......

c¾²Ì¬±àÒëÁíÒ»¸öÎļþ¼ÐµÄ¿âº¯Êý - C/C++ / CÓïÑÔ

ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......

Ϊʲôxml²»ÄÜÏÔʾ°¢À­²®ÎÄ - C/C++ / C++ ÓïÑÔ

ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À­²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À­²®ÎĵÄ×Ö¿âÄãÓÐô£¿

ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......

c±à³ÌÇóÖú - C/C++ / CÓïÑÔ

ÊäÈë10ѧÉúµÄ³É¼¨£¬¹²4¿Æ£¬°´ÕÕÒªÇó±àдʵÏÖÏÂÁй¦ÄܵijÌÐò£¨ÓÃ×Óº¯ÊýʵÏÖ£©
1 Çó³öÿ¿ÆµÄƽ¾ù³É¼¨ ½«Æ½¾ù·Ö¡µ90µÄͬѧµÄÅÅÐò
×÷ÒµÌù~£¡

àÅ ÎÒͬѧ¸øÎÒ·¢µÄ×÷Òµ ÎÒ×òÌì×öÁË µ«Êǽá¹ûÔËÐв»¶Ô ×òÌìÓкö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ