原文:Java調用C(Linux下實現Java本地方法) 一、Java類中聲明本地方法,使用native關鍵字 public class MyNative { public void showParms(String s, int i, boolean b) { showParms0(s, i, b); } public int hypotenuse(int a, int b) { return hypotenuse0(a, b
section("L1_code") int SetProcessorSpecificDefaultConfiguration(ADI_NET2272_DEVICE *pDev){/* enable async bank 3 */*pEBIU_AMGCTL |= 0xF;ssync();/* default settings, one should be able to change through device controls before issuing USB_CMD_START *
//=====================================================================//TITLE:// C++ VS C#(9):繼承//AUTHOR:// norains//DATE:// Thursday 17-January-2011//Environment:// Visual Studio 2010// Visual Studio 2005//==========================
//=====================================================================//TITLE:// C++ VS C#(4):枚舉,結構體//AUTHOR:// norains//DATE:// Tuesday 7-December-2010//Environment:// Visual Studio 2010// Visual Studio 2005//=======================
原文連結:http://forums.codeguru.com/showthread.php?315371-Visual-C-Debugging-How-to-use-ASSERT-and-deal-with-assertions-failuresQ: What is an assertion?A: An assertion statement specifies a condition that you expect to hold true at some particular point
最近在重新溫習演算法導論,書裡面的演算法一段時間不看就會忘記,於是我就想重新用C語言碼出來,等以後自己再用複習或要用的時候,直接閱讀代碼,更加方便。 書上講的第一個演算法也是個人認為最簡單的一個——插入排序,作者把插入排序比作打撲克牌時的摸排並排序,很形象,下面是插入排序的代碼:#include <stdio.h>void insert_sort(int a[], unsigned int n){unsigned int i, j;int temp;for (i = 1
Android Runtime使得直接調用底層Linux下的可執行程式或指令碼成為可能比如Linux下寫個測試載入器,直接編譯後apk中通過Runtime來調用或者寫個指令碼,apk中直接調用,省去中介層或者JNI這個至少效率應該比較高吧 代碼:public class test extends Activity {TextView text; /** Called when the activity is first created. */ @Override
原文地址:http://www.dz3w.com/mcu/clanguage/050409//C272.htm在C語言中,static的字面意思很容易把我們匯入歧途,其實它的作用有三條。(1)先來介紹它的第一條也是最重要的一條:隱藏。當我們同時編譯多個檔案時,所有未加static首碼的全域變數和函數都具有全域可見度。為理解這句話,我舉例來說明。我們要同時編譯兩個源檔案,一個是a.c,另一個是main.c。下面是a.c的內容char a = 'A'; // global variablevoid