Time of Update: 2018-12-04
1. 基本解釋 typedef為C語言的關鍵字,作用是為一種資料類型定義一個新名字。這裡的資料類型包括內部資料類型(int,char等)和自訂的資料類型(struct等)。 在編程中使用typedef目的一般有兩個,一個是給變數一個易記且意義明確的新名字,另一個是簡化一些比較複雜的型別宣告。 至於typedef有什麼微妙之處,請你接著看下面對幾個問題的具體闡述。 二、 typedef & 結構的問題
Time of Update: 2018-12-04
前兩天去hp面試,有個題問建構函式和解構函式可不可以顯示調用。 回來上網查了下,原來兩個都是可以顯示調用的。如下:class A{ public: A() { cout<<"a cnostructor"<<endl; } ~A() { cout<<" a destructor"<<endl; }}; void
Time of Update: 2018-12-04
一、tcp:1、tcp每個通訊端都有一個緩衝區,當應用進程調用write時便把應用程式層的資料寫入通訊端的緩衝區;2、如果通訊端的緩衝區容不下應用程式層的資料,則write阻塞。write返回只表示將資料寫到了套介面緩衝區,並不表示發送出去;3、通訊端的緩衝區裡的資料需收到接收方的確認訊息(ack)才會刪除緩衝區裡的資料。二、udp:1、udp是不可靠的,因此無需緩衝區儲存應用程式層傳過來的資料。只是將資料拷貝到核心的緩衝區,鏈路層發送出去以後就將拷貝丟棄;2、udp只有一個緩衝區大小的概念,如
Time of Update: 2018-12-04
1. Linux下,如何看每個CPU的使用率:#top -d 1之後按下數字1. 則顯示多個CPU (top後按1也一樣)Cpu0 : 1.0%us, 3.0%sy, 0.0%ni, 96.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%stCpu1 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st2. 在Linux下,如何確認是多核或多CPU:#cat
Time of Update: 2018-12-04
我們知道,在c++的類中,不能在聲明變數時直接將給其賦值。但是引用變數和常量必須在聲明時賦值。為瞭解決這個問題,可以再建構函式時使用初始化類表方式(引用變數和常量必須使用這種方式)。如:類的聲明: Class Test { public: Test(int a,int& b, int c);// private: int i; int & j;
Time of Update: 2018-12-04
fedora使用rpmfusion源安裝ffmpeg已有 329 次閱讀2012-4-22 09:38|系統分類:福士軟體|fedora,ffmpeg, rpmfusionrpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpmrpm -ivh
Time of Update: 2018-12-04
#include<cstdio>#include<cstdlib>#include<iostream>#include<fstream>#include<string>#include<cstring>using namespace std;class News{public: News () {number=0;name=string("unkonw");score1=0;score2=0;} News(
Time of Update: 2018-12-04
01、 關閉selinux以root身份編輯/etc/selinux/config檔案,更改其中的SELINUX項的值就可以關閉和啟用SELinux服務了。修改成 SELINUX=disable 禁用SeLinux修改成 SELINUX=enforcing 使用SeLinux如果只是想臨時關閉selinux,可以在終端中輸入:$ sudo setenforce 0#####02、 添加YUM源一般系統內建的更新源速度很慢,可以使用國內網易或搜狐的鏡像。到其開源鏡像網站http:/
Time of Update: 2018-12-04
While trying to run a yum update I received the below warning message: Setting up Install ProcessResolving DependenciesThere are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.-->
Time of Update: 2018-12-04
/* * File: main.cpp * Author: chujiangke * * Created on 2013年4月1日, 下午11:04 */#include <cstdlib>#include <iostream>using namespace std;/* * */class point{ int a; int b; //point(point&);public: point(int b,int
Time of Update: 2018-12-04
#include <iostream>#include <functional>#include <iterator>#include <vector>#include <algorithm>using namespace std;class fun1{ int a; int b; public: fun1(int x,int y):a(x),b(y){} int get_x(){return a;} int
Time of Update: 2018-12-04
方法一:grub2是通過/etc/grub.d/目錄下的檔案順序來決定啟動項順序的:$cd /etc/grub.d$ls -l-rwxr-xr-x 1 root root 3296 2009-10-24 08:44 00_header-rwxr-xr-x 1 root root 1154 2009-10-24 08:31 05_debian_theme-rwxr-xr-x 1 root root 3778 2009-10-24 08:44 10_linux-rwxr-xr-x 1
Time of Update: 2018-12-04
#include <iostream>#include <vector>#include <iterator>#include <algorithm>#include <functional>using namespace std;class fun{private:int a;int b;public: fun(int x=0,int y=0){a=x;b=y;} bool operator==(fun
Time of Update: 2018-12-04
#include <stdio.h>#include <stdlib.h>#include <iostream>using namespace std;void main(){int m_array[10];//定義一個10位長的整形數組int length;//用於記錄數組的長度char c=' ';//定義一個字元來判斷使用者是否按下了斷行符號cout<<"請輸入數,個數小於等於10個,並以斷行符號鍵結束"<<endl;for (i
Time of Update: 2018-12-04
6410的中斷系統:嵌入式軟體裡的中斷處理,除了中斷初始化,主要工作就是編寫ISR. 在嵌入式的SOC的CPU裡,在CPU裡內部會帶一些裝置模組,它們產生的中斷稱為內部中斷。因為聯線比較固定,因此編程比較簡單。而且在物理上CPU分離的晶片產生的中斷,稱為外部中斷,外部中斷可以聯結不同的中斷腳上,因此需要對中斷IO進行較複雜的配置。 輪詢模式是否一無是處?輪詢的優點是在重負荷的情況下,輪詢比中斷效率會高很多。比如一個教室很多學生不斷的問問題,這樣與其不斷被中斷,老師還不如起身在教室走動,隨
Time of Update: 2018-12-04
#include<iostream>#include<vector>#include<iterator>#include<functional>#include<algorithm>#include<string>#include<fstream>using namespace std;template<class Type>void swap1(Type &a,Type &b){
Time of Update: 2018-12-04
#include <iostream>#include <string>#include <iterator>#include <functional>#include <vector>#include <cmath>#include <ctime>using namespace std;int main(){ vector<int> coll;srand(time(NULL));
Time of Update: 2018-12-04
根據微軟的文檔,安裝順序如下:1.Visual Studio 20052.Visual Studio 2005 Service Pack 1(檔案名稱:VS80sp1-KB926601-X86-ENU.exe)3.Visual Studio 2005 Service Pack 1 Update for Windows Vista (檔案名稱:VS80sp1-KB932232-X86-ENU.exe)4.Windows Embedded CE 6.05.Windows Embedded CE 6.
Time of Update: 2018-12-04
#include <iostream>#include <fstream>#include <string>#include<cstring>using namespace std;double m1[30][30], m2[30][30], m3[30][30];ifstream inData;ofstream outData;void getMatrix(double [][30], ifstream &);void
Time of Update: 2018-12-04
(轉)W: GPG 錯誤:http://extras.ubuntu.com precise Release: 下列簽名無效分類: learning 2012-09-24 10:58 800人閱讀 評論(0) 收藏 舉報(轉)http://forum.ubuntu.org.cn/viewtopic.php?f=80&t=372236sudo apt-get cleancd /var/lib/aptsudo mv lists lists.oldsudo mkdir -p