Time of Update: 2018-12-03
1、#include <string.h>void *memcpy( void *to, const void *from, size_t count );功能:函數從from中複製count 個字元到to中,並返回to指標。 如果to 和 from 重疊,則函數行為不確定。 注意點:(1)第一個參數是目標指標,第二個參數是起始指標,不要搞錯了。
Time of Update: 2018-12-03
1、C++中數組作為實際參數傳遞的三種形式參數方法 #include<iostream>using namespace std;void change(int& a,int b){ //通過引用,引用是原變數的別名,變數值返回時會受影響 a=5;}void change1(int* a,int b){ //通過指標進行傳遞,變數值返回時會受影響 *a=0;}void change2(int a,int b) { //變數值返回時不會受影響
Time of Update: 2018-12-03
本文主要來講解C++中的RTTI機制,也就是動態類型識別技術,之前我在學習《C++編程思想》的時候學習過這個技術,現在也算是複習一下吧,因為RTTI在MFC程式設計中也是有一定用處的。 先來看一段程式,這段程式中就是使用了RTTI,#include <typeinfo>#include <iostream>#include <fstream>using namespace std;ofstream out("out.txt");class
Time of Update: 2018-12-03
C語言庫函數http://www.fzs8.net/C_Function/2007-06-13/c_5890.html C語言中system()函數在windows和linux下的使用windows作業系統下system () 函數詳解 函數名: system 功 能: 發出一個DOS命令 用 法: int system(char *command); system函數已經被收錄在標準c庫中,可以直接調用 程式例: #include <stdlib.h> #inclu
Time of Update: 2018-12-03
#include<pthread.h>#include<stdio.h>#include<stdlib.h>#include<string.h>#include<semaphore.h>#include <unistd.h>#define THREAD_NUM 25typedef struct{ FILE *_fp; int _nThreadId;//第幾個線程 sem_t
Time of Update: 2018-12-03
C 二維數組(指標)動態分配和釋放先明確下概念:所謂32位處理器就是一次只能處理32位,也就是4個位元組的資料,而64位處理器一次就能處理64位,即8個位元組的資料。如果我們將總長128位的指令分別按照16位、32位、64位為單位進行編輯的話:舊的16位處理器,比如Intel 80286
Time of Update: 2018-12-03
今天遇見了這個問題 因為我更新了最新的adt 出現ADB server didn't ACK, failed to start daemon 然後你想啟動一個程式 這個時候又會出現 Please ensure that adb is correctly located at 'D:\android-sdk-windows\platform-tools\adb.exe' and can be executed. "首先呢 查看是否查看工作管理員,是否有關閉所有adb.exe
Time of Update: 2018-12-03
對於我這樣一個C#菜鳥,啥都不會,啥都得在網上找資料,一點一滴的學,很困難,所以把自己學習過程中遇到的一些兒問題記錄於此,便於自己複查,也便於其它同仁學習。
Time of Update: 2018-12-03
非C++內建型別 A 和 B,在哪幾種情況下B能隱式轉化為A?答:a. class B : public A { ……} // B公有繼承自A,可以是間接繼承的b. class B { operator A( ); } // B實現了隱式轉化為A的轉化c. class A { A( const B& ); } // A實現了non-explicit的參數為B(可以有其他帶預設值的參數)建構函式d. A& operator= ( const A& ); // 賦值操作,雖不
Time of Update: 2018-12-03
#include <stdio.h>#include <stdlib.h>#include <math.h>int isPrime(int x){if(x<=0){return 0;}else if(x==1 || x==2){return 1;}else{int i;for(i=2;i<x;i++){if(x%i==0){break;}}if(i==x){return 1;}else{return 0;}}}void main(){int
Time of Update: 2018-12-03
//*********************************************************************//第9題//顯示特殊矩陣//*********************************************************************#include <stdio.h>#include <stdlib.h>#include <math.h>void main(){int array[6
Time of Update: 2018-12-03
string類預設產生的函數有哪些?預設建構函式解構函式拷貝建構函式賦值建構函式 具體實現如下:#include <iostream>using namespace std;class mystring{friend ostream &operator<<(ostream &out,const mystring &s);public:mystring(const char *str=NULL);mystring(const mystring
Time of Update: 2018-12-03
#include <iostream>using namespace std; class B {public:int i, j;B(int x = 999) :j(x),i(j){cout << "B::B() invoked\n" << endl;} ~B(){cout << "B::~B() invoked\n" << endl;}};class D : public B {public:D() {cout <<
Time of Update: 2018-12-03
最近整理文檔,發現上課的時候寫的演算法,有詳細的注釋,發到這裡大家共用一下吧。 void insert_array(int[] A,int n,int item){ int k,m; for(k=0;k<n;k++) if(A[k]>=item) break;/*尋找item的位置*/ for(m=n;m>k;m--) A[m+1]=A[m];/*通過後移插入*/ A[k]=item;/*在此插入*/ return; }void delete_item(int[] A,
Time of Update: 2018-12-03
/// <summary> /// CS下在C#裡調用顯示水晶報表 /// 水晶報表在CrystalReport9中定義,資料來源可以是表、視圖、預存程序(最後一句必須是select語句),可以包含子報表 /// 調用執行個體:LoadReport(this.crystalReportViewer1,"D:\\66.rpt","kys","hrdb","sa","kys"); /// 2004-10-29 writed by 華陽 /// </summary>
Time of Update: 2018-12-03
有以下兩個C++類:class Base {public: Base(int a, int b) : m_a(a), m_b(b) {} virtual void Func1(); virtual int Func2();private: int m_a, m_b;}class Derived : public Base {public: Derived(int a, int b, double d) : Base(a, b), m_d(d) {} virtual
Time of Update: 2018-12-03
最近整理原來的博文,資料結構和演算法,筆試題,眼淚嘩嘩的,網申開始。廢話少說,這次實現的單鏈表類://list.h#ifndef _LIST_H_#define _LIST_H_#ifndef NULL#define NULL 0#endif//C++實現單鏈表template<class T>struct node{T data;node<T> *next;node():next(NULL){}node(T
Time of Update: 2018-12-03
最近整理原來的一些代碼,腦子有點不好使,還是記下來吧。//binary_tree.h,遍曆包含了遞迴和非遞迴兩種,層次遍曆#ifndef _BINARY_TREE_H_#define _BINARY_TREE_H_template<class T> struct BiNode{T data;BiNode<T>* lchild, *rchild;};template<class T>class
Time of Update: 2018-12-03
在做一個小項目,需要把一些查詢結果匯出到Excel,找了一些資料,自己也總結出了一點方法,與大家共用。一、首先簡要描述一下如何操作Excel表先要添加對Excel的引用。選擇項目-〉添加引用-〉COM-〉添加Microsoft Excel 9.0。(不同的office講會有不同版本的dll檔案)。using Excel;using System.Reflection;//產生一個Excel.Application的新進程Excel.Application app = new
Time of Update: 2018-12-03
因為我的工作與GPS,相關,實習期間的項目可以會與GPS的協議相關,所以先自己去看了一下 GPS 有很多種協議,如GSA,GGA .......在這裡我不一一列舉 在這裡我用其中的一種來展示一下 怎麼樣進行協議解析,用一個字串截取函數就可以了下面是一個條類比資料 string sTarget = "$GPGGA,134658.00,5106.9792,N,11402.3003,W,2,09,1.0,1048.47,M,-16.27,M,08,AAAA*60";進行解析