Time of Update: 2018-12-05
最近由於編程的需要,對 C# 的類型轉換做了一些研究,其內容涉及 C# 的裝箱/拆箱/別名、數實值型別間相互轉換、字元的 ASCII 碼和 Unicode 碼、數值字串和數值之間的轉換、字串和字元數組/位元組數組之間的轉換、各種數實值型別和位元組數組之間的轉換、十六進位數輸出以及日期型資料的一些轉換處理,在這裡與大家分享―― 1. 裝箱、拆箱還是別名 許多 C#.NET 的書上都有介紹 int -> Int32
Time of Update: 2018-12-05
《演算法導論》好是好,只是看虛擬碼太頭痛了,總想要是有個C語言版的《演算法導論》就好了。前幾天研究了紅/黑樹狀結構,把它翻譯成C語言。在VC6.0上編譯測試通過。並且寫了一個CView類來顯示效果。 標頭檔 rb_tree.h #ifndef RB_TREE_H#define RB_TREE_Henum NODECOLOR {RED = 0, BLACK = 1};typedef int NODEDATA;struct rb_tree_node{ NODECOLOR color; int
Time of Update: 2018-12-05
// TestingandTobe.cpp : 定義控制台應用程式的進入點。//#include "stdafx.h"#include<iostream>#include<map>#include<string>using namespace std;struct student{// virtual void fun(){ 指標指向未知崩潰 void fun(){m_i=0;cout<<"結構體指標調用結構體中的函數測試,...m_i="
Time of Update: 2018-12-05
NtTerminateProcess 、NtResumeProcess 、NtSuspendProcess這三個函數是微軟核心api可以線上查詢*++Module Name:NtSuspendProcess.cppAbstract:This utility [Suspend|Resume] processes.Author:Michael Wookey 6-Jun-2003
Time of Update: 2018-12-05
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <Windows.h>#include <sql.h>#include <sqlext.h>#include <Sqltypes.h>#include "iostream"using namespace std;/*
Time of Update: 2018-12-05
今天剛開始學多線程,儘管以前用過一點點,但是只是照著網上代碼抄,沒有真正理解,現在回過頭來想研究研究,慢慢弄懂,下面就是我在網上所找資料的例子,相信大家都看過,做了小點改動 using System;using System.Threading;namespace biovision.ihospital.his.Basic{ public class Simple { public static int Main() {
Time of Update: 2018-12-05
#include <linux/kernel.h>#include <linux/module.h>#include <linux/platform_device.h>#include <linux/dma-mapping.h>#include <linux/slab.h>#include <linux/init.h>#include <linux/clk.h>#include
Time of Update: 2018-12-05
Static Array:typename[]=new typename[Size]{data1,data2......}; Dynamic Array:Use List<t> or ArrayList Example:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace
Time of Update: 2018-12-05
介面永遠不能直接執行個體化。--msdn 但可以說這樣用 介面 執行個體 = new 實現介面的類() ; 表示產生一個實現某某介面的類的對象。 針對介面編程能協助達到物件導向開發和設計中"低耦合"的要求. 舉個例子:某公司有一台特殊印表機,還可以使用一年,一年後可能換為另一種印表機,這兩種印表機都特殊而貴.所以現在的程式希望換了印表機後也少量修改就可用. 方法: 1,定義一個印表機介面.
Time of Update: 2018-12-05
#include <stdio.h>#include <string.h>int n, a[100];int used[100];int num[100];void dfs( int x ){int i;if( x >= n ){for( i = 0; i < n; i++ )printf( "%d ", num[i] );printf( "\n" );}else{for( i = 0; i < n; i++ )if( !used[i] ){num[x]
Time of Update: 2018-12-05
首先看如-1示範的用c語言編寫的例子程式。 ┌————————————————————┐ │ 1. void fun() │ │ 2. { │ │ 3. printf(“Hello World\n”); │ │ 4. } │ │ 5. int main()
Time of Update: 2018-12-05
第三章資源管理條款13:以對象管理資源RAAI(Resource Acquisition IsInitialization: RAII)
Time of Update: 2018-12-05
總結一下最近的狀態最近工作發生一些變動,工作內容中又多了.NET相關的工作一個不大不小的功能比計劃工作量多出一倍,回過頭再看看,主要是沒有認真去使用現有的資源,重複造了個輪子! 1. 使用正則驗證2. 進行日期轉換 public class SimpleConvert { /** * 字串日期轉換為標準日期文字 * @param str 字串 * @param formInst Form表單引用,用於列印測試內容
Time of Update: 2018-12-05
//程式很簡單,相信大家都會,也會比好寫的好。我寫的很爛.........................//不過有幾個地方相信初學者,剛開始學習跟我一樣有點迷糊。#include<iostream>using namespace std;const int SIZE=15; class point{private: const int size; //這裡在類的私人資料中定義了常量 char *pf; int d; long zs,suz; long
Time of Update: 2018-12-05
匯總c#.net常用函數和方法集 [ 作者: | 來源:CSDN 文檔| 點擊數: src="http://www.sohozu.com/Click.asp?filename=13054263905"> 674]1、DateTime 數字型 System.DateTime currentTime=new System.DateTime(); 1.1 取當前年月日時分秒 currentTime=System.DateTime.Now; 1.2 取當前年 int
Time of Update: 2018-12-05
一、C中CONST的使用來自:http://blog.chinaunix.net/u/26828/showart_667881.htmlconst是一個C語言的關鍵字,它限定一個變數不允許被改變。使用const在一定程度上可以提高程式的健壯性,另外,在觀看別人代碼的時候,清晰理解const所起的作用,對理解對方的程式也有一些協助。 雖然這聽起來很簡單,但實際上,const的使用也是c語言中一個比較微妙的地方,微妙在何處呢?請看下面幾個問題。 問題1:const變數 & 常量
Time of Update: 2018-12-05
/* * File: main.cpp * Author: Vicky * */#include <iostream>#include <cstdarg>/** 建立函數類型,可以用於建立函數數組 */typedef void (*FUNC_t)(int id, int args_size, ...);void pcreate(int id, int args_size, ...) { std::cout << "create" <<
Time of Update: 2018-12-05
最新的cocos2d-x版本為2.1.3,在調用build_native.sh產生時沒問題,但在build_native.sh clean時出現了以下錯誤。Clean: chipmunk_static [armeabi]/bin/sh: -c: line 0: syntax error near unexpected token `('/bin/sh: -c: line 0: `rm -rf (TARGET_OBJS)'make: ***
Time of Update: 2018-12-05
sizeof,一個其貌不揚的傢伙,引無數菜鳥竟折腰,小蝦我當初也沒少犯迷糊,秉著“辛苦我一個,幸福千萬人”的偉大思想,我決定將其儘可能詳細的總結一下。但當我總結的時候才發現,這個問題既可以簡單,又可以複雜,所以本文有的地方並不適合初學者,甚至都沒有必要大作文章。但如果你想“知其然,更知其所以然”的話,那麼這篇文章對你或許有所協助。菜鳥我對C++的掌握尚未深入,其中不乏錯誤,歡迎各位指正啊1.
Time of Update: 2018-12-05
J.U.C是java系列一塊看似簡單,水很深的地區,但是不論是深入java還是分布式的一些東西,這都算是基礎,雖然以前亂七八糟寫過一些多線程的文章,不過都比較亂了一點,最近有打算逐步深入來寫多篇文章來說說我對這些東西的小理解。1、首先線程分為核心線程、使用者線程;在Linux下java的線程其實是在java私人棧上有一個使用者線程,和OS層級有一個輕量級的進程來實現。2、在操作java多線程的時候必然會遇到鎖的問題,在鎖的問題中,線程會首先進入一個所謂的Entry