C/C++/VC ʵÏÖ×Ö·û´®ÄæתµÄ¶àÖÖ·½·¨
/¼ÓÁËÏÂÃæÁ½¸öÍ·Îļþ£¬ÊÇΪÁËÔÚWin32¹¤³ÌÖÐʹÓÃMFCµÄÌØÐÔ!
#include <afx.h>
#include <afxwin.h>
#include "stdio.h"
#include "conio.h"
////¼ÓÁËÏÂÃæÁ½¾ä£¬ÊÇΪÁËÄܹ»ÓÃstring(basic_stringÀàÐÍ)
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
// string _strtemp = "1111";
// TRACE("\n string = %s \n",_strtemp.c_str() );
// printf("\n string = %s \n",_strtemp.c_str() );
// printf("\n Hello World! \n");
// getch();
CString sTemp;
sTemp.Format("jkgja");
AfxMessageBox(sTemp);
return 0;
}
/************************************************************************/
/* ʵÏÖ×Ö·û´®Äæת */
/************************************************************************/
/////·½°¸Ò» Óô¿Cº¯ÊýʵÏÖ
/*#include <iostream>
#include <string>
using namespace std;
int main()
{
string str = "abcdefghijklmn";
cout<<str.c_str()<<endl;
cout<<strrev(strdup(str.c_str()))<<endl;
system("pause");
return 0;
}*/
///// ·½°¸¶þ ÓÃSTLº¯ÊýʵÏÖ
// reverse_copy.cpp
// compile with: /EHsc
// Illustrates how to use the reverse_copy function.
//
// Functions:
// reverse_copy - Reverse a sequence, copy the results to another
// same-sized sequence.
//
//////////////////////////////////////////////////////////////////////
/*
// disable warning C4786: symbol greater than 255 character,
// okay to ignore
#pragma warning(disable
Ïà¹ØÎĵµ£º
1. »ù±¾½âÊÍ
¡¡¡¡typedefΪCÓïÑԵĹؼü×Ö£¬×÷ÓÃÊÇΪһÖÖÊý¾ÝÀàÐͶ¨ÒåÒ»¸öÐÂÃû×Ö¡£ÕâÀïµÄÊý¾ÝÀàÐÍ°üÀ¨ÄÚ²¿Êý¾ÝÀàÐÍ£¨int,charµÈ£©ºÍ×Ô¶¨ÒåµÄÊý¾ÝÀàÐÍ£¨structµÈ£©¡£
¡¡¡¡ÔÚ±à³ÌÖÐʹÓÃtypedefÄ¿µÄÒ»°ãÓÐÁ½¸ö£¬Ò»¸öÊǸø±äÁ¿Ò»¸öÒ×¼ÇÇÒÒâÒåÃ÷È·µÄÐÂÃû×Ö£¬ÁíÒ»¸öÊǼò»¯Ò»Ð©±È½Ï¸´ÔÓµÄÀàÐÍÉùÃ÷¡£
¡¡¡¡ÖÁÓÚtypedefÓÐʲô΢ÃîÖ®´ ......
ͨÓú¯Êý¿âÔÚÍ·Îļþstdlib.hÖÐÉùÃ÷£¬±È½ÏÅÓ´ó£¬Ö÷Òª·ÖΪÒÔϼ¸´óÀࣺ´æ´¢·ÖÅä¡¢Ëæ»úÊýÉú³É¡¢Êý×Öת»»ÓëÕûÐÍÔËËã¡¢³ÌÐòÍ˳öÓë»·¾³Í¨ÐÅ¡¢ËÑË÷ÓëÅÅÐò¡¢¶à×Ö½ÚÓë¿í×Ö·ûµÄת»»¡£ÓÉÓÚ¼³¼°µ½´æ´¢·ÖÅä¡¢»·¾³Í¨Ðŵȣ¬Òò´ËËüÃǵĴó¶àÊýÒ²ÒÀÀµÓÚ²Ù×÷ϵͳ¡£glibcÖУ¬Í¨Óú¯Êý¿âµÄºËÐÄʵÏÖÔÚstdlibºÍmallocÁ½¸öĿ¼Ï ......
LinuxÏ»ñµÃϵͳʱ¼äµÄCÓïÑÔµÄʵÏÖ·½·¨
#include<time.h> //CÓïÑÔµÄÍ·Îļþ
#include<stdio.h> //C﵀I/O
void main()
{
time_t now; //ʵÀý»¯time_t½á¹¹
struct tm *timenow; //ʵÀý»¯tm½á¹¹Ö¸Õë
time(&now);
//timeº¯Êý¶ÁÈ¡ÏÖÔÚµ ......
»ùÓÚÓÅÏȼ¶µÄ²Ù×÷ϵͳ£¨preemptive operating system£©±ØÐëʹÓÃijÖÖËã·¨ÒÔ¾ö¶¨CPUÈçºÎµ÷¶ÈϵͳÖеÄỊ̈߳¬±¾Õ½«ÌÖÂÛWindows VistaʹÓõĵ÷¶ÈËã·¨¡£ ÎÒÃÇ֮ǰÌÖÂÛ¹ýÏ̵߳ÄÉÏÏÂÎĽṹCONTEXT£¬ÆäÖк¬ÓÐÏß³Ì×îºóÒ»´ÎÖ´ÐÐʱCPU¼Ä´æÆ÷×éµÄ״̬¡£ ²Ù×÷ϵͳÿ20ºÁÃë¼ì²éϵͳÖÐËùÓÐÏß³ÌÄں˶ÔÏóµÄ״̬£¬ÆäÖÐһЩ¶ÔÏó±»ÈÏΪÊǿɵ÷¶È£ ......