pointers

    2熱度

    4回答

    參數引用是否有物理變量?例如在下面的代碼: void scalewindowsize (HWND &ownerwin, HWND &childwin) { char buffer[100]; snprintf (buffer, 100,"%d", (intptr_t)&ownerwin); MessageBox (NULL, buffer, "fail", NULL

    0熱度

    2回答

    我試着寫這個東西在C: (*(result+1))!="\0" 編譯器說:在條件(*(result+1))=!"\0" 什麼問題 可能的分配?

    2熱度

    1回答

    可能重複: View array in Visual Studio debugger? 我50個元素的數組使用聲明: int *ans; ans = new int[50]; 然而,當我在看的 '當地人' 名單,並嘗試爲了擴大陣列,它只有一個 元素,爲什麼?難道我做錯了什麼?

    0熱度

    3回答

    「自由」考慮下面的代碼: RTIME *rtCreate(void) { RTIME *rtime; rtime = malloc(sizeof(*rtime)); if (rtime != NULL) { /* Initialization stuff */ } return rtime; } void rtD

    1熱度

    1回答

    大家好我正在編寫一個python腳本來訪問winscard.dll的windows。 lib = cdll.LoadLibrary('winscard.dll') hSC = c_long(0) lRetval = lib.SCardEstablishContext(0,None,None,pointer(hSC)) 上述返回一個錯誤值如下 Traceback (most recent c

    4熱度

    1回答

    我有一個C函數返回字符串(char *),我們稱之爲foo()。 在python中,我想調用它並使用它的返回值,當我完成時,我想調用另一個C函數,它釋放返回的字符串foo。 如何獲得指針和字符串本身?如果我這樣做: fooFunc = foolib.foo fooFunc.restype = c_char_p r = fooFunc() 然後我得到的字符串,但不是指針。如果我在沒有指定re

    2熱度

    3回答

    我正在試驗指針和字符串。在下面的代碼中,所有的東西都經過測試(你可以自己編譯和運行),但是當我試圖使用strcmp時,我一直崩潰。該代碼在代碼塊中運行時沒有警告。你能指出我的錯誤,使程序崩潰? #include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int cho

    0熱度

    1回答

    這是我的問題: /** * Example of the book: * C++ Templates page 17/18 */ #include <iostream> #include <cstring> #include <string> // max of two values of any type (call by reference) template <typen

    0熱度

    5回答

    我學習C++,我發現這對一本書: #include <iostream> using namespace std; int main() { int Age = 30; int* pInteger = &Age; // pointer to an int, initialized to &Age // Displaying the value of pointer cout <<

    4熱度

    1回答

    這是錯誤: DummyService.hpp:35: error: invalid covariant return type for 'virtual std::vector < ResourceBean*, std::allocator < ResourceBean*> >& DummyService::list(const std::string&)' class Bean { publi