struct

    1熱度

    2回答

    我想知道是否有任何示例代碼用於實現類型爲struct的NSMutableArray的Objective-C。在裏面,我需要在結構中聲明2個可變數組(也可以通過NSMutableArray)。我書中的所有代碼示例都向我展示瞭如何通過C數組語法(使用括號)創建一個定義大小的數組,但我不知道如何使用NSMutableArray獲得一個數組。有沒有其他人做過?這是我的代碼到目前爲止......編譯好我已經

    2熱度

    2回答

    我正在讀取硬盤的FAT32條目,至今已成功通過使用CreateFile,ReadFile和SetFilePointer API讀取條目。這是我的代碼(用C#編寫)到目前爲止。 ---該DLL進口----- [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr CreateFile(string lpF

    3熱度

    3回答

    1. 我知道可以在聲明中初始化結構數組。例如: struct BusStruct { string registration_number; string route; }; struct BusStruct BusDepot[] = { { "ED3280", "70" }, { "ED3536", "73" }, { "FP6583"

    9熱度

    3回答

    我有一個關於LayoutKind.Explicit屬性集的結構的小問題。正如你所看到的,我聲明瞭struct,其中帶有64位的fieldTotal,最後32字節是fieldFirst,前32字節是fieldSecond。在將fieldfirst和fieldSecond設置爲Int32.MaxValue之後,我希望fieldTotal爲Int64.MaxValue,這實際上不會發生。爲什麼是這樣?我

    2熱度

    2回答

    有沒有辦法忽略的計算使用Marshal.SizeOf的結構尺寸的領域 例: public struct Message { public ushort X; public ushort Y; // Ignore this field in the calculation } int size = Marshal.SizeOf(typeof(Message)); 眼下

    0熱度

    3回答

    我想在F#中創建一個結構來表示海圖中的深度曲線。它必須包含一個座標列表和一個浮標,用來表示所代表的深度(例如「4.5米」)。我曾這樣說: type Coord = struct val X : float val Y : float new(x,y) = { X = x ; Y = y } end type DepthCurve =

    4熱度

    2回答

    最後更新時間:2009-08-11下午2:30 EDT 前幾天我張貼this question的一些很奇怪的問題。那麼,我想出了什麼是造成一臺機器上的內部版本無法在其他機器上運行的問題,甚至還提出了一個解決方法,但現在它給我留下了一個很好的具體問題:爲什麼? 要重現該問題,我創建了一個新的InteropUserControl並執行以下操作: 添加新public struct MyStruct: 給

    3熱度

    4回答

    我想要(在Fedora在GCC 4.3 11點i586的)運行下面的代碼內的結構: #include <stdio.h> #include <stdint.h> #include <stdlib.h> struct s_smallstruct{ int smallstruct; }; struct s_test2{ cha

    0熱度

    5回答

    抓取數據可以說我有這樣的結構: typedef struct nKey { int num; widget* widget; } NUMBER_KEY; 和功能: void dialKey(widget* widget) { // Need to print 'num' of the struct that this widget resides in }

    3熱度

    6回答

    我正在使用C語言這對於服務器和客戶端都是公用平臺。 我有一個特定類型的結構,我想從服務器發送到客戶端。 例如, 服務器代碼 //necessary declarations struct hostent *hp; hp=gethostbyname("www.google.com"); sendto(sockDes,&hp,sizeof(hp),0,(struct sockaddr *)