看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): Win10 編譯器 : VC++ *[m 額外使用到的函數庫(Library Used): STL 問題(Question): 類別的.h無法初始化2D陣列,所以放到類別的cpp. 而.h需要public宣告, 供 main()調用 . 有沒有好的範例, 可以實現呢? 我使用vector, 在執行時期會出現 vector subscript out of range. 若使用普通陣列,.h的宣告跟.cpp屬不同倆陣列,需要memcpy... 想看看有沒有好做法. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.160.23.112 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1668002685.A.722.html
wulouise: 你要貼程式啊...可以試試看godbolt.org 11/10 00:07