dynamic-arrays

    0熱度

    1回答

    這裏只是一個疑問。我有2個指針的指針.. ** M1,**平方米和m2被初始化爲: - m2 =(int **) calloc(5, sizeof(int *)); for(int i=0; i<5; i++) m2[i] = (int *)calloc(8, sizeof(int)); 和指針具有值..就像二維數組..在每個位置。 可我就是不喜歡 - m1 = m2; free(m2)

    -6熱度

    1回答

    查看C和C++代碼中的用戶輸入(內部for循環)。我們在C++中使用用戶輸入*(p + i),C中使用(p + i)在C中缺少*的原因是什麼? Plz解釋!看看將COMMENT這行......在for循環 #include <iostream> using namespace std; int main() { int n,i; cout << "Ent size"

    3熱度

    3回答

    返回它的價值我有這個功能作爲一個階級的一部分,我寫: const char* sockets::TCPSocket::doRecv(int flags) { char* incomingDataBuffer = new char [this->bufferSize]; ssize_t bytesReceived = recv(this->filedes, incomingDa

    2熱度

    2回答

    我正在使用基本類並嘗試訪問成員函數中的成員字符串數組。我很困惑,因爲字符串數組初始化並沒有任何內存錯誤(博士存儲器)被釋放的時候,如果我只能調用set_words,print_words,並del_words功能: class XWORD { public: int vdir; int len; int wid; int nWords;

    0熱度

    2回答

    當我按下「添加按鈕」時,我想添加更多的LinearLayout在一個空的列表中。 當我第一次按「它工作」,空的LinearLayout表明我想但如果我再次按下按鈕不起作用(LogCat顯示我出現NullPointerException)。我發現它不是在前一個之下創建一個新的LinearLayout,也不知道如何解決它。 讓我告訴你我的代碼部分: 首先,我創建 static int ID=0; .

    0熱度

    4回答

    所以我想寫一個方法,將返回最大面積的對象的索引。這是我目前的方法 private static int findPositionLargestObject(ArrayList <GeometricObject> geoList) { int maxIndexC = 0; int maxIndexR = 0; for (GeometricObject o: geoLis

    0熱度

    2回答

    Array ( [1~course2 20:00] => Array ( [0] => Array ( [pid] => 30 [anz_tn] => 6 ) [1] => Array ( [pid] => 30 [anz_tn] =

    0熱度

    1回答

    我想實現一個多線程的C程序,我卡住了。 我有持有字符數組和指針到另一個結構的結構體(我嘗試使用指針的buffer_item秒的數組: typedef struct{ char** buffer; } buffer_item; typedef struct{ buffer_item* buffers; char file_name[255]; }buffe

    1熱度

    1回答

    import std.math; import std.bigint; import std.stdio; BigInt sum_min_pfactor(long N){ BigInt f(int n) { return BigInt(n)*(BigInt(n)+1)/2 - 1; } int v = cast(int)(sqrt(float(N

    -3熱度

    1回答

    我創建二維動態陣列(進制)的特定值動態2D陣列,並且初始化所有元素爲-1 ,,,然後我想設置數組元素與一些值,,但劑量不工作 int rowCount,t; t=4; rowCount = t/3 + (t % 3 != 0); int** ary = new int*[rowCount]; for(int i = 0; i < rowCount; ++i) ary[i] =