Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ctypes の「キャスト」関数を使用して、ある整数形式を別の整数形式にキャストし、C と同じ効果を得るにはどうすればよいですか。
int var1 = 1; unsigned int var2 = (unsigned int)var1;
?
>>> cast((c_int*1)(1), POINTER(c_uint)).contents c_uint(1L) >>> cast((c_int*1)(-1), POINTER(c_uint)).contents c_uint(4294967295L)