void-pointers
Genericity vs type-safety? Using void* in C
Coming from OO (C#, Java, Scala) I value very highly the principles of both code reuse and type-safety. Type arguments in the above languages do the job and enable generic data structures which are bo[详细]
2022-12-14 02:54 分类:问答Constructing python function callable from C , with input parameter having *output* semantics
The use case is the following: Given a (fixed, not changeable) DLL implemented in C Wanted: a wrapper to this DLL implemented in python (chosen method: ctypes)[详细]
2022-12-14 00:22 分类:问答Byte precision pointer arithmetic in C when sizeof(char) != 1
How can one portably perform pointer arithmetic with single byte precision? Keep in mind that: char is not 1 byte开发者_如何学Python on all platforms[详细]
2022-12-13 07:43 分类:问答Pointer arithmetic when void has unknown size [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a[详细]
2022-12-13 07:22 分类:问答Passing Void type parameter in C
Hello there I am working on an assignment in C where I need to pass in an unknown ty开发者_如何学JAVApe of parameter into a function.[详细]
2022-12-12 17:38 分类:问答void pointers: difference between C and C++
I\'m trying to understand the differences between C and C++ with regards to void pointers. the following compiles in C but not C++ (all compilations done with gcc/g++ -ansi -pedantic -Wall):[详细]
2022-12-11 17:13 分类:问答Find out Type of C++ Void Pointer
I have a small question: how do I find out what type a C++ pointer is? I often use a small function in my console programs to gather input, which looks something like this:[详细]
2022-12-11 08:18 分类:问答Implementing Win32 FileWrite
[DllImport(\"kernel32.dll\", SetLastError=true)] public static extern unsafe bool WriteFile(IntPtr hFile, void* lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, IntPtr lpOverlapp[详细]
2022-12-10 12:16 分类:问答error: cast from 'void*' to 'int' loses precision
I have a function with prototype void* myFcn(void* arg) which is used as the starting point for a pthread.I need to convert the argument to an int for later use:[详细]
2022-12-10 12:12 分类:问答sizeof void pointer
wh开发者_Python百科y is sizeof void pointer 2 ?The size of a void* is a platform dependent value.Typically it\'s value is 4 or 8 bytes for 32 and 64 bit platforms respectively.If you are getting 2 as[详细]
2022-12-07 21:45 分类:问答