• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            分享知識

            與大家一起分享知識

            C++博客 首頁 新隨筆 聯系 聚合 管理
              19 Posts :: 3 Stories :: 45 Comments :: 0 Trackbacks
            re: 我的程序人生[未登錄] 史傳紅 2007-01-24 14:00
            樓主對軟件領域的涉足很廣泛,而且有點領域也很精深,是我學習的楷模啊。
            re: 計算Int最大最小值 史傳紅 2006-12-04 09:24
            很好。
            re: 并行編程--MPI開發入門 史傳紅 2006-06-12 20:12
            我現在也在搞這方面的研究,不過是在linux系統下,多多向你學習。
            很不錯。
            re: 五一就要回家嘍 史傳紅 2006-05-15 14:24
            謝謝,我是吉林大學(朝陽校區)畢業的。
            謝謝大家的祝福.我是安徽六安市霍邱縣眾興鄉洪崗村中心隊人(夠詳細的吧,呵呵).
            @小東
            相信只要努力了,我們一定都會有所收獲的.此外我也算是一個比較幸運的人而已.相信有很多朋友比我更努力,但是過得比我還艱難...
            謝謝大家的鼓勵,我會一直盡力努力下去的.
            最好,就是你安裝一個電子郵件服務器軟件。這下,你想打多長時間,就打多長時間。
            請問它和電子郵件服務器怎么聯系上的?如何設置?謝謝.
            原因不是*this不能轉換成const vector3D&,而是常成員函數(double angle() const)不能調用 非 常成員函數(double dotP(const Vector3D& v1,const Vector3D& v2)),如果把dotp改成如下定義:double dotP(const Vector3D& v1,const Vector3D& v2) const.
            問題就解決了.
            re: 漫談函數的返回值 史傳紅 2006-05-03 23:01
            @&lt;font color=&quot;#FF00FF&quot; &gt;Stone Jiang
            希望是這樣的.
            re: 關于語句作用域 史傳紅 2006-05-03 10:30
            是的,標準規定了for(int i=0;i<10;i++)中的i只在語句內有效,可見。
            我覺得用string時間快的原因可能跟這句:char *pc2= new char[len+1];
            有關。庫在處理string時候可能有某種優化,使得處理時間快些。也就是不同的系統在優化 string str2=str; 的時候可能不一樣,所以windows系統沒有占到優勢。
            @flyingxu

            由于我以前遇到這個問題沒有解決,現在看了深入淺出MFC這本書,總結出來的,你能給出一個好的結構嗎?我的意思是說把文檔的數據在一個對話框中實時表現出來,謝謝。
            re: c++程序員 常用工具集 史傳紅 2006-04-24 13:33
            版本控制現在比較不錯的是 svn.
            @Stone Jiang
            能把這篇文章貼出來嗎?我打開連接發現是好多主題。謝謝。
            @roa420
            我在Visual C++ 6.0中編譯的時候也出現過問題,我懷疑它對友元支持的不好。
            建議你換一個編譯器試試看。
            re: 關于C++模板函數的問題 史傳紅 2006-04-12 14:11
            原來是我和標準模板庫的函數重名了。通過改成:

            template <class T>
            const T& my_max(const T& a,const T& b)
            {
            return a > b ? a : b;
            }
            const float f = my_max(1.5f,2.5f);
            就沒有問題了。
            看到了樓主的這篇文章,我試著改了一下,如下:希望大家一起加入討論。

            #include <iostream>
            using namespace std;

            class Matrix
            {
            private:
            int rows,columns;
            int **pMatrix;
            public:
            Matrix(int rows = 3,int columns = 2);
            Matrix(const Matrix &M);
            ~Matrix();
            Matrix& operator=(const Matrix& M);
            int GetRows() const;
            int GetColumns() const;
            void SetValue();
            friend Matrix operator*(const Matrix& a,const Matrix& b);
            friend ostream& operator<<(ostream& os,const Matrix& M);
            };

            int Matrix::GetRows() const { return rows;}
            int Matrix::GetColumns() const { return columns;}

            // 構造函數
            Matrix::Matrix(int x,int y)
            {
            rows = x;
            columns = y;
            //有的時候為了考慮創建對象的效率,在使用的時候分配存儲空間,而不在構造函數中分配
            pMatrix = new int* [x];
            for (int i = 0 ; i < x; i++ )
            {
            pMatrix[i] = new int[y];
            for(int j = 0;j < y;j++) //初始化每個值為0
            pMatrix[i][j] = 0;
            }
            }
            // 析構函數
            Matrix::~Matrix()
            {
            for (int i = 0 ;i < rows;i ++ )
            delete[] pMatrix[i];
            delete[] pMatrix;
            }

            // 賦值函數
            Matrix& Matrix::operator=(const Matrix& M)
            {
            if(this != &M)
            {
            for (int ii = 0 ;ii < rows;ii++ )
            if(pMatrix[ii])
            delete[] pMatrix[ii];
            if(pMatrix)
            delete[] pMatrix;
            rows = M.rows;
            columns = M.columns;
            //分配存儲空間
            pMatrix = new int* [rows];
            for (int k = 0 ; k < rows; k++ )
            pMatrix[k] = new int[columns];

            for ( int i = 0 ; i < rows; i ++ )
            for ( int j = 0 ; j < columns; j ++ )
            pMatrix[i][j] = M.pMatrix[i][j];
            }
            return *this;
            }
            void Matrix::SetValue()
            {
            int i,j,value;
            for ( i = 0 ; i < rows; i ++ )
            {
            for ( j = 0 ; j < columns; j ++ )
            {
            cout << " 第 " << i << " 行 " ;
            cout << " 第 " << j << " 列: " ;
            cin >> value;
            cout << endl;
            pMatrix[i][j] = value;
            }
            }
            }
            // 拷貝構造函數
            Matrix::Matrix(const Matrix& M)
            {
            rows = M.rows;
            columns = M.columns;
            //分配存儲空間
            pMatrix = new int* [rows];
            for (int k = 0 ; k < rows; k++ )
            pMatrix[k] = new int[columns];

            for ( int i = 0 ; i < rows; i ++ )
            for ( int j = 0 ; j < columns; j ++ )
            pMatrix[i][j] = M.pMatrix[i][j];
            }

            Matrix operator*(const Matrix& a,const Matrix& b)
            {
            if (a.columns == b.rows)
            {
            Matrix c(a.rows,b.columns);
            for ( int i = 0 ;i < a.rows;i ++ )
            {
            for ( int j = 0 ;j < b.columns;j ++ )
            {
            for ( int columnIndex= 0 ;columnIndex < a.columns;columnIndex++ )
            c.pMatrix[i][j] += a.pMatrix[i][columnIndex] * b.pMatrix[columnIndex][j];
            }
            }
            return c;
            }
            else
            return Matrix();
            }

            ostream& operator<<(ostream& os,const Matrix& M)
            {
            for (int i = 0;i < M.rows;i++ )
            {
            for (int j = 0;j < M.columns;j++ )
            os << M.pMatrix[i][j] << " ";
            os << endl;
            }
            return (os << endl);
            }


            // 主函數
            void main()
            {
            Matrix Ma(3,2),Mb(2,2);
            Ma.SetValue();
            Mb.SetValue();
            cout << Ma << endl;
            cout << Mb << endl;

            Matrix Mc = Ma * Mb;//拷貝構造函數
            cout << Mc << endl;
            Mc = Mb; //=運算符,即賦值函數
            cout << Mb << endl;
            }
            re: C++跨平臺開發方法/工具 史傳紅 2006-04-06 18:16
            我覺得在一臺機器上擁有兩個系統,速度是相當慢的,我深有體會.我目前用的兩種方法,覺得效率挺高:
            1.用putty這個軟件從windows登陸linux系統,然后在windows里面用UltraEdit編寫源代碼.通過putty在linux系統編譯和執行.
            2.用BVRDE這個軟件就可以做到在windows下面做linux開發,它只是一個IDE,所用的文件,編譯器和調試器等都在linux系統上面.下載網址:
            http://bvrde.sourceforge.net/index.htm
            久久99久久成人免费播放| 成人午夜精品久久久久久久小说 | 久久久久亚洲AV片无码下载蜜桃| 中文字幕久久精品| 久久精品人妻中文系列| www久久久天天com| 三级片免费观看久久| 亚洲精品无码专区久久久| 久久―日本道色综合久久| 人妻中文久久久久| 久久精品视频免费| 伊人色综合久久天天人手人婷| 国产成人精品久久二区二区| 久久免费香蕉视频| 国产成人精品久久免费动漫| 久久亚洲国产最新网站| 激情综合色综合久久综合| 久久精品aⅴ无码中文字字幕不卡| 久久久久亚洲AV无码专区网站 | 色8激情欧美成人久久综合电| 97久久精品国产精品青草| 亚洲AV日韩精品久久久久久 | 偷偷做久久久久网站| 久久久久久综合一区中文字幕 | 国产无套内射久久久国产| 中文字幕乱码久久午夜| 无码任你躁久久久久久久| 99热成人精品免费久久| 久久青草国产精品一区| 久久综合综合久久综合| 精品国产乱码久久久久久呢| 亚洲精品97久久中文字幕无码| 狠狠色伊人久久精品综合网| 青青青青久久精品国产| 久久免费高清视频| 99久久精品这里只有精品| 中文字幕久久欲求不满| 国产午夜电影久久| 蜜桃麻豆www久久国产精品| 亚洲人成无码久久电影网站| 亚洲欧美精品一区久久中文字幕|