C ºê¶¨ÒåµÄ¼òµ¥×ܽá
ÎÒÔÚд´úÂëµÄʱºòϲ»¶Ê¹Óú꣬²»½öʹ´úÂë¿´ÆðÀ´Õû½à£¬¶øÇÒÓúÃÁË»¹Äܼ«´óµÄ¼õÇá±àÂëµÄ¹¤×÷Á¿£¬µ«ÊÇÈç¹ûʹÓò»µ±µÄ»°£¬³öÁËÎÊÌâ²éÕÒÆðÀ´¾Í¾Í·Ç³£µÄÄÑÁË£¬ÏÂÃæµÄ×ܽá´ó²¿·ÖÊÇ´ÓÍøÉÏ¿´µ½µÄ£¬Ò²ÓÐһЩÊÇÎÒ×Ô¼ºÔÚ¹¤×÷ÖÐ×ܽá³öÀ´µÄ¡£
ºêʹÓÃÖеij£¼ûµÄ»ù´¡ÎÊÌâ
1. ·ÀÖ¹Ò»¸öÍ·Îļþ±»Öظ´°üº¬
#ifndef BODYDEF_H
#define BODYDEF_H
//Í·ÎļþÄÚÈÝ
#endif
2. ÖØÐ¶¨ÒåһЩÀàÐÍ£¬·ÀÖ¹ÓÉÓÚ¸÷ÖÖÆ½Ì¨ºÍ±àÒëÆ÷µÄ²»Í¬£¬¶ø²úÉúµÄÀàÐÍ×Ö½ÚÊý²îÒ죬·½±ãÒÆÖ²¡£
typedef unsigned char boolean; /* Boolean type. */
typedef unsigned long uint32; /* Unsigned 32 bit */
typedef unsigned short uint16; /* Unsigned 16 bit */
typedef unsigned char uint8; /* Unsigned 8 bit */
typedef signed long int int32; /* Signed 32 bit */
typedef signed short int16; /* Signed 16 bit */
typedef signed char int8; /* Signed 8 bit */
//ÏÂÃæµÄ²»½¨ÒéʹÓÃ
typedef unsigned char byte; /* Unsigned 8 bit type. */
typedef unsigned short word; /* Unsinged 16 bit type. */
typedef unsigned long dword; /* Unsigned 32 bit type. */
typedef unsigned char uint1; &nbs
Ïà¹ØÎĵµ£º
1.ΪʲôÎÒдµÄMakefile£¬ÔÚ±à¼ÁËÔ´´úÂëÎļþºó£¬Ê¹ÓÃmake£¬makeÈ´ÌáʾĿ±êÎļþÒѾΪ×îеÄÁË£¡
2.OpenGL,ÔÚ´°¿ÚÖлµãʱ£¬ÔõÑùʹÓÃglVertexi()º¯Êý£¿ÒòΪ´«µÝµÄ²ÎÊýÈç¹ûÊÇ´óÓÚ1µÄintÐÍ£¬Ôò²»ÐУ¬¶ø±ØÐë´«µÝ[-0.1~0.1]Ö®¼äµÄfloat£¬¶øÇÒʹÓú¯Êý
gVertex2f().
3.OpenGL,ʹÓò˵¥Ê±£¬ÔõÑù½â¾öµã»÷²Ëµ¥ºó²»Òª²¶×½GLUT_UPÊ ......
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main(){
int sockfd;
int len;
struct sockaddr_in address;
int result;
char *strings="GET /svnup/rewrite.php HTTP/1 ......
wchar_t wsWorkingDir[256] = _T("");
CString strPDF(_T(""));
::GetCurrentDirectory(256, wsWorkingDir);
strPDF.Format(_T("%s"), wsWorkingDir);
if (strPDF.GetAt(strPDF.GetLength()-1) != '\\')
{
strPDF += '\\';
}
strPDF += "doc\\my.pdf" ......
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#define f(a,b) a##b
#define g(a) #a
#define h(a) g(a)
int main()
{
char a = 'a';
......
#include <stdio.h>
long long mod(long long a,long long b)
{
return (a % b + b) % b;
}
struct triple
{
long long d,x,y;
};
long long Euclid(long long a,long long b)
{
if(b == 0)
return a;
else
retu ......