[英]What is the most efficient way to represent the infinite tape of a Turing machine in Python?
[英]What is the most common way to represent a byte array in C?
我們會使用char
、 signed char
、 unsigned char
還是導入一些 header 作為byte
類型?
我的代碼將被其他 C 開發人員看到/使用,我想使用他們最有可能看到的任何標准。
另外,我可能會從 python 為這個 function 分配 memory 作為 Z2EA9510C37F7F62F89E49CB41F7 數組並調用它。 在 numpy 中分配字節數組是否有首選方法?
例如,如果相應的 C 類型是char
, np.zeros(size, dtype=np.byte)
是正常方式嗎?
最常見的方法是使用 char 數組。 但是,這實際上取決於代碼的需要。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.