garbage

    -3熱度

    1回答

    在下面發佈的代碼中,從文件讀寫結構時存在問題。輸出結果是垃圾數據,我無法自己找到解決方案。使用的操作系統:Ubuntu。 #include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct eventos { int id; char titl[60]; char desc[120

    1熱度

    1回答

    我知道如何通過它的引用變量設置爲空留下一個信號垃圾收集器刪除對象: Player player_reference = new Player(); player_reference = null; // Now the Garbage collector knows to release all the memory related to this object. 但我怎麼能設置參考變量通

    -8熱度

    2回答

    我已經寫了一個代碼來打印2名工人的名字,但是卻打印出垃圾。 cout << "highest salary: " << highestSalary.getID() << " " << highestSalary.getName() << endl; cout << "hardest worker: " << mostHours.getID() << " " << mostHours.getNa

    4熱度

    2回答

    我發佈了我的錯誤代碼的截圖。 heights輸出 請任何一個能幫助我嗎?

    -1熱度

    2回答

    我一個無法跟蹤這些垃圾收集器是invoked.plz幫助 class Garbage01 { public static void main(String args[]) { Garbage01 h = new Garbage01(); h.methodA(); /* Line 6 */ } Object methodA() { Object obj1 =

    1熱度

    1回答

    *更新 - 增加了一個示例代碼視圖的一個* 這已經討論了很多次,我已經經歷了很多的建議了這個話題,但我還是不要沒有任何運氣。 我的應用程序是基於選項卡的,即用戶在全局搜索框中搜索實體,並在選擇實體時生成視圖/模型,並在新選項卡下呈現視圖。用戶可以通過重複上述操作打開多個選項卡處理。 我面臨的問題是每次打開一個新選項卡時,我都可以看到瀏覽器內存消耗量增加了大約6 MB(每個選項卡顯示的數據取自&最大

    0熱度

    4回答

    我是一名C++程序員,想要掌握C語言的語法,並且我不明白爲什麼當我在此函數中使用指針時會得到垃圾值。 #include<stdio.h> #include <math.h> void separate(double, double *dollar, double *quarter, double *dime, double *nickle, double *penny); int mai

    2熱度

    5回答

    假設我正在刪除名爲「Enemy」的「死」對象。 使用這樣的事情: for(int i = 0; i < enemies.size(); i++) { Enemy en = (Enemy) enemies.get(i); if(en.getVisible() == true) en.update(); else enemies.remo

    3熱度

    2回答

    很多JavaScript性能導遊往往強調兩點: 逗留範圍之內;逐步查找變量是很昂貴的。 不要通過不斷創建不必要的變量來濫用垃圾收集器。 對於以60fps或類似高速運行的程序,性能是否有所不同? JSPerf似乎在我的系統上的兩個之間,所以我想知道更多關於如何優化這種類型的東西。考慮到以下兩個代碼示例: var t0; function doSomethingGlobal() { t0

    1熱度

    3回答

    我想運行一個簡單的代碼,其中前幾行是 **System.out.println("Enter the number of nodes\n"); BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in)); int n = bufferRead.read(); Sys