Time of Update: 2015-05-22
標籤:資料結構 c++ 單鏈表 操作 類模板 //標頭檔#ifndef _LIST_H#define _LIST_H#include<iostream>using namespace std;template<class Type>class List;template<class Type>
Time of Update: 2015-05-22
標籤:資料結構 c++ 單迴圈鏈表 操作 類模板 //標頭檔#ifndef _LIST_H#define _LIST_H#include<iostream>using namespace std;template<class Type>class CList;template<class Type&
Time of Update: 2015-05-22
標籤:c語言隨機數 c語言產生隨機數 #include <stdio.h>#include <time.h>//time的標頭檔#include <stdlib.h>//rand的標頭檔int main(){srand((int)time(NULL));//設種子for(int i=0;i<10;i++){int num=rand()%100+1;//產生1-100之間的數printf(
Time of Update: 2015-05-23
標籤:簡單原廠模式 c++ 表驅動法 設計模式 上回《大話設計模式C++版——簡單原廠模式》中指出了簡單原廠模式的缺陷,即違背了開發—封閉原則,其主要原因是由於switch的判斷結構的使用,使修改或添加新的對象時需要改動簡單工廠類的代碼,如何改造switch結構,表驅動法就可以粉墨登場了。表驅動法的介紹見《資料驅動編程之表驅動法》。1、面向介面編
Time of Update: 2015-05-23
標籤:template 鏈表 雙向迴圈鏈表 #include <iostream>using namespace std;template<typename Type>struct Node{ Node<Type> *next; Node<Type> *prve; Type data; Node(Type d = Type(
Time of Update: 2015-05-22
標籤:1.指向常量的指標變數 指向常量的指標變數的定義方法: const 類型標識符 *指標變數名; 如: const int *p; 這種方法定義的指標變數只可讀取它所指向的變數或常量的值,不可藉助該指標變數對其所指向的對象的值進行修改(即重新賦值)。但是,可允許這種指標變數指向另外一個同類型的其他變數。 本人自學,教材可能有點老,有問題的話求大家指正!!!謝謝!!! 2.指標常量 指標常量的定義格式: 類型標識符 *const
Time of Update: 2015-05-23
標籤:主要內容:一、C++文法特點簡介二、第一個HelloWorld情境三、建立一個情境 一、C++文法特點簡介1. 函數的聲明和定義分開例如AppDelegate.h中聲明的函數都在AppDelegate.cpp中定義TIPS:按F12直接跳到Definition2. #include先行編譯在需要調用其他類中的一些方法時,必須#include其標頭檔比如這裡如果不#include
Time of Update: 2015-05-23
標籤:// CTest.cpp : 定義控制台應用程式的進入點。//#include "stdafx.h"#include <iostream>#include <string.h>#include <stdio.h>using namespace std;class str{private: char s[80];public: str(char c[]){ strcpy(s,c); } str(){ }
Time of Update: 2015-05-23
標籤:設計模式 原廠模式 簡單原廠模式 c++ 簡單原廠模式應該是所有設計模式中最簡單,也最基礎的一種模式,以下是一個簡單的採用原廠模式寫一個加減法的計算機。1、抽象介面類——依賴倒轉原則(高層和底層都要依賴於抽象,針對介面編程)class IOperation{public:IOperation() : m_nNuml(0), m_nNumr(0)
Time of Update: 2015-05-23
標籤:在拼接SQL的時候經常會遇到此類問題,尤其是in查詢的時候,內容是一段 單引號的 字元的時候
Time of Update: 2015-05-23
標籤: 1 #include "stdafx.h" 2 #include <iostream> 3 using namespace std; 4 5 int _tmain(int argc, _TCHAR* argv[]) 6 { 7 char **p; 8 char * b[] = {"Fortran","C/C++","Pascal","Basic"}; 9 p = b;10 cout<< *p<<endl;
Time of Update: 2015-05-23
標籤:// CTest.cpp : 定義控制台應用程式的進入點。//#include "stdafx.h"#include <iostream>using namespace std;class Circle{ private: double x,y,r; public: void display(){
Time of Update: 2015-05-23
標籤:參考自《C++ Primer Plus 6th Edition》和 《C++ Primer 5th Edition》 (本博文中知識點較為零散和基礎,主要用於本人的學習回顧) 訪問所建立對象的公有成員 1. 自動儲存類對象: "句點方法"2. 動態儲存裝置類對象(使用new):
Time of Update: 2015-05-23
標籤:#include <iostream>#include<string>using namespace std;string add(string s1,string s2){ string s0; int c=0;if(s1.size()<s2.size()){string ss;ss=s1;s1=s2;s2=ss;}int len1=s1.size()-1,len2=s2.size()-1;while(len1>=0){char m;if(
Time of Update: 2015-05-22
標籤:一,JNI java 調c++動態庫函數的問題 1.多參數回傳 2.參數傳遞出現亂碼 二,解決 1.使用byte[]數組傳入c++,在產生的標頭檔裡就會變成jbyteArray 類型 例如,java 中參數:byte[]account,標頭檔裡參數變成jbyteArray account, 通過c++修改完account的值後,java要擷取該值,直接使用 jbyte* jbAccount =
Time of Update: 2015-05-21
標籤:第一題:簡單題目(求和,最大值,最小值)題目描述任意給定n個整數,求這n個整數序列的和、最小值、最大值輸入描述輸入一個整數n,代表接下來輸入整數個數,n<=100,接著輸入n個整數,整數用int表示即可。輸出描述輸出整數序列的和、最小值、最大值。用空格隔開,佔一行範例輸入21 2範例輸出3 1 2#include<iostream>using namespace std;int main(){ int n,a,i,sum=0,min=0,max=0; cin&
Time of Update: 2015-05-23
標籤:c# servlet 需求通用訊息介面使用servlet作為伺服器端服務介面,第三方應用程式通過http post的方式調用servlet,實現與通用訊息介面的調用串連。 參數說明如下: msgTitle:訊息標題,描述發送訊息的標題 serviceId:服務編號,訊息的服務編號 msgDesp:訊息描述,訊息的詳細內容 msgURL:URL地址,訊息中包含的 URL
Time of Update: 2015-05-23
標籤:
Time of Update: 2015-05-23
標籤: 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName-擷取模組的完整路徑。2. System.Environment.CurrentDirectory-擷取和設定目前的目錄(該進程從中啟動的目錄)的完全限定目錄。3.
Time of Update: 2015-05-22
標籤:namespace nameclass2{ class Class2 //方法的重載 { public void Function( string s) { Console.WriteLine(s); } public void Function(string s,string s2) { Console.WriteLine(s+s2); } }