linuxÏÂcÓïÑԹػú³ÌÐò
/* Offtimer.c.For auto halt. */
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#define DELAY 60/* Time of sleeping */
int main()
{
time_t now;
struct tm *p;
while(1)
{
now = time(NULL);
sleep(DELAY);/* To reduce cpu occupation */
p = localtime(&now);
if ((p->tm_hour = 14) && (p->tm_min >= 30))/ *This means the system will halt after 14:30 or 14:31 */
system("poweroff"); / *'poweroff' is the command in Red Flag Linux
Desktop 5.0 to turn off the computer.To do this you should be root. */
}
return 0;
}
ÒýÓÃgcc±àÒ룬ÁíÍâÐèÒªÓÐrootÓû§µÄȨÀû²ÅÄÜÐС£
Ïà¹ØÎĵµ£º
Ê®ÔÂÄ©ubuntu9.10·¢²¼£¬Á¢¿Ì»»ÉÏÁËеģ¬ÎÒÏë×Ô¼º²¢²»ÊÇÔÚ¿ÌÒâ×·Çóеİ汾¡£Ö»ÊÇÒÔǰÔÚµçÄÔÉÏÓÃwubi×°µÄÄǸöylmfµÄÊÇÔÚ²»ºÃ
Óã¬firfoxÖ»ÄÜÊÇ3.0°æ±¾µÄ£¬×ÔÐбàÒëÈí¼þ»¹²»»á£¬ÓÃwine×°Ò»¸öie¾ÓÈ»Óõ½µçÄÔËÀ»ú£¬ÊÇÔڸоõ²»µ½linuxÓÐʲôºÃµÄ£¬¸üÈÃÈËÄÑÊܵÄÊÇ×Ö
ÌåÏÔʾЧ¹û²î£¬firfox
operaʹÓÃÒ»»ÎÒ»»ÎµÄ£¬ËÙ¶ÈÌ«Âý£¬Õû¸ ......
ǰÑÔ£¬Linux/Unix ÉçÇøµÄ°æ¿é²»ÈÈÄÖ£¬ÐÂÊÖÌ«¶à£¬¸ßÊÖ̫棬ż°Ñ×Ô¼ºÕ⼸ÄêµÄLinuxѧϰµÄ¹ý³Ì½²½²£¬Ï£ÍûÄܸø´ó¼ÒÓеã°ïÖú£¬
Òýµ¼³õѧÕßѧϰµÄ·½Ïò£¬ÉÙ×ßÍä·£¬Ê°빦±¶£¬Í¬Ê±Ò²ÊÇÅ×שÒýÓñ£¬Çë¹ýÀ´ÈËÈÈÁÒ·¢ÑÔ¡£
1. Ê×ÏÈÊìϤ Linux
½¨ÒéÔÚ Windows Éϰ²×° VMware Workstation 6.5.0(ÒÔϼò³ÆVM£©, ÏÂÔØÖÖ×ÓÔÚ ......
°²×°eclipse-cpp-galileo-win32.zip
ÒÔÏÂÊÇ×îÐÂeclipse cpp ¿ª·¢IDE
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR1/eclipse-cpp-galileo-SR1-win32.zip
ÉèÖÃmake³ÌÐò
ÉèÖÃbinary parser
н¨Ò»¸öC++¹¤³Ì
±àдͷÎļþ
±àдʵÏÖ
¸ÄдMakefile ¡ ......
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define err(msg) perror(msg)
static void mkdirs(const char *dir)
{
char tmp[1024];
char *p;
&nbs ......
#include <Windows.h>
#include <math.h>
#include "resource.h"
#define PI 3.1415976/180
int dwCenterX,dwCenterY,dwRadius;
const TCHAR *szAppName=TEXT("Clock");
LRESULT CALLBACK ProcWinMain(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
void ShowTime(HWND hwnd,HDC hdc);
void ......