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

C/C++ʱ¼äº¯Êý

clock()·µ»Øclock_tÀàÐÍ£»
ÔÚtime.hÍ·ÎļþÖУ¬¶¨ÒåÁË typedef long clock_t
clock()ÊÇÓÃÀ´¼ÆËãÁ½¸öʱ¼äµãÖ®¼äµÄʱ¼ä¼ä¸ô¡£ÈçϳÌÐò£º
#include <stdio.h>
int main()
{
 int i = 0;
 clock_t start_time, end_time;
 start_time = clock(); //¿ªÊ¼¼Æʱ, start_time = 0
 
 while(i < 10000000)
  i++;
 
 end_time = clock();
 printf("from 0 to 10000000 empty loops: %d (ms)\n", end_time - start_time);
 return 0;
}
ps:°Ñint i = 0;·ÅÔÚclock_t start_time, end_time;Ö®ºó¾Í»á³öÏÖ´íÎó£¨ÔÚvc 6.0±àÒë»·¾³Ï£©
time_t
time()ÓÃÀ´µÃµ½ÏµÍ³µ±Ç°µÄʱ¼ä£¬ÊÇ´Ó1970Äê1ÔÂ1ºÅ0ʱ0·Ö0Ã뿪ʼ¼ÆËãµÄÃëÊý
ÔÚtime.hÍ·ÎļþÖУ¬¶¨ÒåÁËtypedef long time_t
time_t¿ÉÒÔͨ¹ýgmtime(const time_t *timeptr), localtime(const time_t* timeptr)ת³Éstruct tm*¸ñʽ
tmµÄ¶¨ÒåÈçÏ£º
struct tm {
         int tm_sec;      /* Ãë – È¡ÖµÇø¼äΪ[0,59] */
         int tm_min;      /* ·Ö - È¡ÖµÇø¼äΪ[0,59] */
         int tm_hour;     /* ʱ - È¡ÖµÇø¼äΪ[0,23] */
         int tm_mday;     /* Ò»¸öÔÂÖеÄÈÕÆÚ - È¡ÖµÇø¼äΪ[1,31] */
         int tm_mon;      /* Ô·ݣ¨´ÓÒ»Ô¿ªÊ¼£¬0´ú±íÒ»Ô£© - È¡ÖµÇø¼äΪ[0,11] */
         int tm_year;     /* Äê·Ý£¬ÆäÖµµÈÓÚʵ¼ÊÄê·Ý¼õÈ¥1900 */
         int tm_wday;     /* ÐÇÆÚ – È¡ÖµÇø¼äΪ[0,6]£¬ÆäÖÐ0´ú±íÐÇÆÚÌ죬1´ú±íÐÇÆÚÒ»£¬ÒÔ´ËÀàÍÆ */
         int tm_yday;     /* ´ÓÿÄêµÄ1ÔÂ1ÈÕ¿ªÊ¼µÄÌìÊý – È¡ÖµÇø¼äΪ[0,365]£¬ÆäÖÐ0´ú±í1ÔÂ1ÈÕ£¬1´ú±í1ÔÂ2ÈÕ£¬ÒÔ´ËÀàÍÆ */
         int tm_isdst;    /


Ïà¹ØÎĵµ£º

[ת]C/C++ HOOK API£¨Ô­ÀíÉîÈëÆÊÎöÖ® LoadLibraryA£©

9Ô¶¼¿ì½áÊøÁË£¬Ö®Ç°Ò»Ö±Ã¦µ½Ð´×Ô¼ºµÄ¶«Î÷¼ÓÉÏÉÏ°à¡£»ù±¾Ã»ÓÐʱ¼äÑо¿Ï»ã±àºÍC C++·½ÃæµÄ¸ÐÐËȤµÄ¶«Î÷¡£ÔÙÔõô˵Â9Ô»¹ÊǵÃдһƪÈö£¬ÒÔºóÿÔÂÖÁÉÙһƪ°É¡£¸ø×Ô¼º¶¨ÁË£¬Ï£Íû´ó¼Ò¼à¶½¡£ºÙºÙ£¡
ÕâƪÎÄÕ¾ÍÀ´Ì¸Ì¸Æ½³£ºÜ³£¼ûµÄHOOK¼¼Êõ£¬ÕâÀïÄØ¡£Ð´µÃ±È½Ï¼òµ¥£¬·½·¨ºÜ¶à¡£Ö»½²Ô­Àí£¡Ï£Íû´óÄñÃDZðÍÂÎÒ¿ÚË®¹þ - -¡£ºÃ£¡ÇÐÈëÕ ......

cºÍc++ÏÂÓÃջʵÏÖÊýµÄ½øÖÆת»»

1. CµÄʵÏÖ
//stack.h
#ifndef STACK_H
#define STACK_H
#define STACK_CAPACITY 20//maximum size of stack
typedef int stackEle;
typedef struct
{
stackEle myArray[ STACK_CAPACITY ];
int myTop;
}stack;
//construct(initialize) an empty stack
stack *stack_init(void);
//return 1 if stack is em ......

VC++Á¬½ÓAccess

VC++Á¬½ÓAccess
/*
*¶ÁÈ¡AccessÊý¾Ý¿âÖеÄÊý¾Ý
*/
void CMFCSQLDlg::OnButton1()
{
CoInitialize(NULL);
       _ConnectionPtr  m_pAppConn;
       HRESULT hResult;
 
     try
      ......

linux c/c++ GDB½Ì³ÌÏê½â

GDB
ÊÇ
GNU
¿ªÔ´×éÖ¯·¢²¼µÄÒ»¸öÇ¿´óµÄ
UNIX
ϵijÌÐòµ÷ÊÔ¹¤¾ß¡£»òÐí£¬¸÷λ±È½Ïϲ»¶ÄÇÖÖͼÐνçÃ淽ʽµÄ£¬Ïñ
VC
¡¢
BCB
µÈ
IDE
µÄµ÷ÊÔ£¬µ«Èç¹ûÄãÊÇÔÚ
UNIX
ƽ̨ÏÂ×öÈí¼þ£¬Äã»á·¢ÏÖ
GDB
Õâ¸öµ÷ÊÔ¹¤¾ßÓбÈ
VC
¡¢
BCB
µÄͼÐλ¯µ÷ÊÔÆ÷¸üÇ¿´óµÄ¹¦ÄÜ¡£Ëùν

´çÓÐËù³¤£¬³ßÓÐËù¶Ì

¾ÍÊÇÕâ¸öµÀÀí ......

android ±àÒëNative CµÄhello,worldÄ£¿é

±àÒëNative CµÄhello,worldÄ£¿é
    Android ±àÒë»·¾³±¾Éí±È½Ï¸´ÔÓ£¬ÇÒ²»ÏñÆÕͨµÄ±àÒë»·¾³£ºÖ»Óж¥²ãĿ¼Ï²ÅÓÐMakefileÎļþ£¬¶øÆäËûµÄÿ¸öcomponent¶¼Ê¹ÓÃͳһ±ê×¼µÄ Android.mk. Android.mkÎļþ±¾ÉíÊDZȽϼòµ¥µÄ£¬²»¹ýËü²¢²»ÊÇÎÒÃÇÊìϤµÄMakefile£¬¶øÊǾ­¹ýÁËAndroid×ÔÉí±àÒëϵͳµÄºÜ¶à´¦Àí£¬Òò´ËÒªÕæÕýÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ