pointers

    0熱度

    2回答

    #include<stdio.h> typedef struct student{ int id; int mark; }stud; typedef struct stud *s1; void main(){ s1 = NULL; printf("hi"); } 請幫助我如何將結構指針初始化爲NULL。編譯期間出現以下錯誤。 graph.c: In function ‘

    1熱度

    2回答

    if (mySharedState -> liveIPs -> find(flowStats -> destinationIP) != mySharedState -> liveIPs -> end()){ //do something } unordered_map <uint32_t, std::string> *liveIPs; 我從來沒有見過這樣的用法(找到(...)和結束

    1熱度

    2回答

    我用C++編寫了一個簡單的指針代碼,我得到了圍繞「str」的堆棧損壞的運行時錯誤。 我知道它會給出這個錯誤,如果你試圖去到一個未分配的地方在一個數組中,但在這種情況下,當指針變爲'\ 0',而停止。 是否可以繼續在內存中指向'\ 0'的ptr? 在此先感謝! : - ) 下面的代碼: #include <iostream> using namespace std; #defin

    0熱度

    1回答

    之間的數據我已經共享庫在哪裏完成一些數據世代/處理,並且我已經寫一些API和應用程序來訪問他們並傳輸數據。 /* ** * ** * ** * ****應用* ** * ** * **/ char* data1; char* data2; genratedCamData(1, char* data1 , char *data2); printf(" data1 %s ",data1);

    1熱度

    1回答

    我無法在任何地方找到它,即使它可能是微不足道的,我想確保我已經很好理解。我有4個問題(嚴格相關的): 1)如果我在FORTRAN限定派生類型是這樣 TYPE :: node INTEGER :: int REAL :: REALfirst REAL :: REALsecond END TYPE TYPE(node) :: var a

    2熱度

    5回答

    我的程序具有這樣的結構: struct point { int x; int y; }*ptt; struct point *pointer(int c, int d) { ptt->x = c; ptt->y = d; return ptt; } int main() { struct point *pqq;

    0熱度

    5回答

    我想從其中包含的方法創建多個對象的方法調用返回一個勁兒地對象中組合多個對象。 Results calculate() { Foo f; Bar b; ... Results r(f, b); return r; } class Results { private: ? public: Results(Foo&

    -1熱度

    1回答

    用戶輸入我必須在數組中收集的圖書。 你能幫我理解爲什麼當我進入第二本書時,第一本書是絢麗的嗎? 我定義全球BOOK輔助... 你能幫我明白爲什麼我不能收集 #define stop __asm nop #include "book.h" #include <iostream> #include <cstdio> using namespace std; int counter = 0

    1熱度

    1回答

    這裏是一個奇怪的事情: 我有一個結構,它包含指向相同類型的結構和指針其他類型的結構,以及其他一些值。 struct animal { struct animal * father; struct race * rc; int age; }; struct race { char colour; }; 一切似乎是確定,當我通過父親訪問值年齡: an

    1熱度

    2回答

    #include <stdlib.h> struct timer_list { }; int main(int argc, char *argv[]) { struct foo *t = (struct foo*) malloc(sizeof(struct timer_list)); free(t); return 0; } 爲什麼上面的代碼段編譯