void-pointers
What level of indirection to use in structs?
I want to create a simple structure that holds an identifier of type int and a value of any kind. Should I use[详细]
2023-02-18 18:49 分类:问答How to send and receive memory addresses via a socket in C?
I want to send/receive a memory address via a socket in C. What I have is the following: void *ptr = malloc(122); /* So the pointer points to some valid address */[详细]
2023-02-12 19:12 分类:问答Arithmetic with void pointers in C++
I need to access an object in a buffer, pointed by a void pointer. The object开发者_高级运维 is located at a certain offset but since arithmetic on a void pointer is prohibited how can I access the ob[详细]
2023-02-12 00:43 分类:问答Passing a void* by reference
Why can\'t I pass a void* by reference? The compiler allows me to declare a function with the following signature:[详细]
2023-02-11 11:06 分类:问答How to cast a void pointer to a pointer when dereferencing?
int x = 5; int *xPtr = &x; void **xPtrPtr = &xPtr; printf(\"%d\\n\", *(int*)*xPtrPtr); I have a void pointer po开发者_高级运维inting to an int pointer. What is the syntax for properly castin[详细]
2023-02-11 06:33 分类:问答Linked list containing other linked lists & free
I have a generic linked list implemen开发者_如何学Gotation with a node struct containing a void* to data and a list struct that holds a reference to head. Now here is my problem a node in the linked l[详细]
2023-02-09 09:14 分类:问答How to dereference multiple void pointers in structs into 1 piece of memory?
I am working on a project where I need to send over a certain IPC stack, (in my case, LCM), and the thing is I need to provide the IPC a variable length struct. I have[详细]
2023-02-08 21:43 分类:问答C Dereference void* pointer
I am new to C and for my first project I need to implement an array based queue. I want my queue to be able to hold any kind of object so I created a QueueElement structure to hold a void pointer to a[详细]
2023-02-07 05:56 分类:问答How do you cast from a bit-field to a pointer?
I\'ve written the following bit of code that is producing a warning: initialization makes pointer from integer without a cast[详细]
2023-02-02 12:24 分类:问答Using void * in C in place of overloading?
My question here is I had seen code like this for a multithreading application: void Thread( void* pParams )[详细]
2023-01-30 03:39 分类:问答