¡¶Cר¼Ò±à³Ì¡·Ñ§Ï°×ܽá2
¡¶Cר¼Ò±à³Ì¡·Ñ§Ï°×ܽá2
ת×Ô £º http://blog.chinaunix.net/u2/87570/showart_2120069.html
±àÒëÆ÷×öÁËЩʲô
ͼ1£º±àÒëÆ÷ͨ³£·Ö¸î³É¼¸¸ö¸üСµÄ³ÌÐò
¾²Ì¬Á´½ÓÓ붯̬Á´½Ó
ͼ2£º¾²Ì¬Á´½ÓÓ붯̬Á´½ÓµÄÇø±ð
¶¯Ì¬Á´½ÓµÄÓÅÊÆ£º
1£¬ ¶¯Ì¬Á´½Ó¿ÉÖ´ÐÐÎļþ±È¹¦ÄÜÏàͬµÄ¾²Ì¬Á´½ÓµÄ¿ÉÖ´ÐÐÎļþµÄÌå»ýС¡£ËüÄܹ»½ÚÊ¡´ÅÅÌ¿Õ¼äºÍÐéÄâÄڴ棬ÒòΪº¯Êý¿âÖ»ÓÐÔÚÐèҪʱ²Å±»Ó³Éäµ½½ø³ÌÖС£ÒÔÇ°£¬±ÜÃâ°Ñº¯Êý¿âµÄ¿½±´°ó¶¨µ½Ã¿¸ö¿ÉÖ´ÐгÌÐòÎļþµÄΩһ·½·¨¾ÍÊÇ°Ñ·þÎñÆ÷ÖÃÓÚÄں˶ø²»ÊǺ¯Êý¿âÖУ¬Ê¹µÃÄÚºËÅòÕÍ¡£
2£¬ ËùÓж¯Ì¬Á´½Óµ½Ä³¸öÌض¨º¯Êý¿âµÄ¿ÉÖ´ÐÐÎļþÔÚÔËÐÐʱ¹²Ïí¸Ãº¯Êý¿âµÄÒ»¸öµ¥¶À¿½±´¡£²Ù×÷ϵͳÄں˱£Ö¤Ó³Éäµ½ÄÚ´æÖеĺ¬Êý¾Ý¿â¿ÉÒÔ±»Ê¹ÓÃËüµÄÆäËû½ø³Ì¹²Ïí£¬ÌṩÁ˸üºÃµÄI/OºÍ½»»»¿Õ¼äÀûÓÃÂÊ£¬½ÚÊ¡ÁËÎïÀíÄڴ棬´Ó¶øÌá¸ßÁËϵͳµÄÕûÌåÐÔÄÜ¡£Èç¹û¿ÉÖ´ÐÐÎļþÊǾ²Ì¬Á´½ÓµÄ£¬Ã¿¸öÎļþ¶¼½«ÓµÓÐÒ»·Ýº¯Êý¿âµÄ¿½±´£¬ÏÔÈ»¼«ÎªÀ˷ѿռ䡣
¹ØÓÚº¯ÊýÁ´½Ó
1£¬ ¶¯Ì¬¿âÎļþµÄÀ©Õ¹ÃûÊÇ.so,¶ø¾²Ì¬¿âÎļþµÄÀ©Õ¹ÃûÊÇ.a£¬²¢ÒÔlibnameµÄÐÎʽÃüÃû¡£
2£¬ gccͨ¹ý-lthreadÑ¡Ï¸æËß±àÒëÆ÷Á´½Ólibthread.so¡£
3£¬ ±àÒëÆ÷ÆÚÍûÔÚÈ·¶¨µÄĿ¼ѰÕҿ⡣ĬÈϲéÕÒһЩÌض¨Ä¿Â¼Èç/usr/lib, /lib£¬-Lpathname¸æËß±àÒëÆ÷ÔÚÆäËûλÖòéÕÒ¿â¡£
4£¬ ͨ¹ý¹Û²ìÍ·Îļþ£¬È·ÈÏʹÓõĺ¯Êý¿â¡£
Èçmath.h-->/usr/lib/libm.so, thread.h—>/usr/lib/libthread.so
ÔËÐÐʱÊý¾Ý½á¹¹
ͼ3£ºÔ´Îļþµ½¿ÉÖ´ÐÐÎļþµÄÓ³Éä
ͼ4£º¿ÉÖ´ÐÐÎļþÄÚºËÓ³Ïñ
ͼ5£º¹²Ïí¿âµÄÐéÄâµØÖ·¿Õ¼ä
ͼ6: ¹ý³Ì»î¶¯¼Ç¼
CÓïÑÔ×Ô¶¯ÌṩµÄ·þÎñÖ®Ò»¾ÍÊǸú×Ùµ÷ÓÃÁ´£¬¼´ÄÄЩº¯Êýµ÷ÓÃÁËÄÄЩº¯Êý£¬µ±ÏÂÒ»¸öreturnÓï¾äÖ´Ðк󣬿ØÖƽ«·µ»ØºÎ´¦µÈ¡£CÓïÑÔͨ¹ý¶ÑÕ»ÖеĹý³Ì»î¶¯¼Ç¼½â¾öÕâÒ»ÎÊÌ⣬µ±Ã¿¸öº¯Êý±»µ÷ÓÃʱ£¬¶¼»á²úÉúÒ»¸ö¹ý³Ì»î¶¯¼Ç¼£¨»òÀàËƵĽṹ£©¡£¹ý³Ì»î¶¯¼Ç¼ÊÇÒ»ÖÖÊý¾Ý½á¹¹£¬ÓÃÓÚÖ§³Ö¹ý³Ìµ÷Ó㬲¢¼Ç¼µ÷ÓýáÊøºó·µ»Øµ÷ÓõãËùÐèÒªµÄÈ«²¿ÐÅÏ¢£¬Èçͼ6Ëùʾ¡£»î¶¯¼Ç¼ÄÚÈݵÄÃèÊöºÜ¾ßÓÐ˵Ã÷ÐÔ£¬½á¹¹µÄ¾ßÌåϸ½ÚÔÚ²»Í¬µÄ±àÒëÆ÷Öи÷²»Ïàͬ¡£¹ý³Ì»î¶¯¼Ç¼²¢²»Ò»¶¨ÔÚ¶ÑÕ»ÖУ¬ÓÐʱΪÁËÌá¸ßЧÂÊ£¬½«¹ý³Ì»î¶¯¼Ç¼ÖÃÓڼĴæÆ÷ÖС£
´Ó¶ÑջʵÏÖº¯Êýµ÷Óõķ½Ê½¿ÉÒÔ½âÊÍΪʲô
Ïà¹ØÎĵµ£º
/*
**ÅжÏC?ÐÐ??¾³µÄ³ÌÐò
*/
/*
**¾²?³õʼ»¯
*/
int static_variable=5;
void
f()
{
register int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
register char *c1, *c2, *c3, *c4, *c5, *c6, *c7 , *c8, *c9, *c10;
extern int a_very_long_name_to_sec_how_long_they_can_be;
double ......
ÒªÈà Eclipse ¿ÉÒÔ¿ª·¢ C/C++ ³Ìʽ£¬Òª¹ÒÉÏ CDT ²Å¿ÉÒÔ¡£
Ê×ÏÈÒªÏÂÔØCDT
CDTµÄ×îа汾ÊÇ 3.1.0£¬ËüÖ§³Öeclipse3.2.0£¬ÆäÏÂÔصØÖ·£ºhttp://download3.eclipse.org/tools/cdt/releases/callisto/dist/3.1.0/£¬»òÕßÊǵ½http://www.eclipse.org/cdt/downloads.phpÏÂÔØÆäËü° ......
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê5ÔÂ8ÈÕ, ÏÂÎç2:47
*/
#include <iostream>
using namespace std;
class A{
public:
A(){
cout << "Ö´Ðй¹Ô캯Êý´´½¨Ò»¸ö¶ÔÏó" << endl;
}
A(A&){
cout << "Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ ......
#include<stdio.h>
#define N 8
void input(int n,int p[N][N])
{
int i,j;
for(i=0;i<n;i++)
{
printf("please input the %d line:\n",i+1);
for(j=0;j<n;j++)
{
scanf("%d",&p[i][j]);
}
}
}
void output(int n,int p[N][N])
......
Àý) Σ険¤Ê¥³ー¥Ç¥£¥ó¥°
1 char cStr[256];
2 ZeroMemory(cStr, sizeof(cStr));
3 &nb ......