tagged [pointers]
What do LRESULT, WPARAM and LPARAM mean?
What do LRESULT, WPARAM and LPARAM mean? I'm importing WinApi functions, writing callbacks etc. ([example](http://msdn.microsoft.com/en-us/library/windows/desktop/ms633573%28v=vs.85%29.aspx)) in C# an...
How to convert const char* to char* in C?
How to convert const char* to char* in C? In my project there is a method which only returns a `const char*`, whereas I need a `char*` string, as the API doesn't accept `const char*`. Any idea how to ...
- Modified
- 11 Mar at 14:7
Pointer to a string in C?
Pointer to a string in C? I know that `ptrChar` is a pointer to . What's the command for a pointer to ? If it's the same (ptr to char vs. ptr to string) — what does the variable definition below repre...
Differences between unique_ptr and shared_ptr
Differences between unique_ptr and shared_ptr > [pimpl: shared_ptr or unique_ptr](https://stackoverflow.com/questions/5576922/pimpl-shared-ptr-or-unique-ptr) [smart pointers (boost) explained](https...
- Modified
- 23 May at 12:2
Is C# Endian sensitive?
Is C# Endian sensitive? Is C# ever Endian sensitive, for example, will code such as this: always assign the same value to b. If so, what value will it be? If not, what good ways are there to deal with...
- Modified
- 11 Feb at 21:37
When to use malloc for char pointers
When to use malloc for char pointers I'm specifically focused on when to use malloc on char pointers Would a malloc be in order for something as trivial as this? If yes, why? If not, then when is it n...
Returning this pointer from a function
Returning this pointer from a function I am trying to return a pointer from a function. But I am getting a segmentation fault. Someone please tell what is wrong with the code
- Modified
- 24 Oct at 02:55
Is there any use for unique_ptr with array?
Is there any use for unique_ptr with array? `std::unique_ptr` has support for arrays, for instance: but is it needed? probably it is more convenient to use `std::vector` or `std::array`. Do you find a...
- Modified
- 17 Jan at 18:4
char* to a string in C#
char* to a string in C# I'm calling a function from a native DLL which returns a `char*` pointer, how can I convert the returned pointer to a string ? I tried : But it just returned a weird Chinese ch...
Passing by reference in C
Passing by reference in C If C does not support passing a variable by reference, why does this work? ### Output:
- Modified
- 5 Sep at 21:57
How to store a function pointer in C#
How to store a function pointer in C# Let's say I want to store a group of function pointers in a `List`, and then later call them, perhaps even with parameters... Like if I stored in a `Dict` could I...
Why use pointers?
Why use pointers? I know this is a really basic question, but I've just started with some basic C++ programming after coding a few projects with high-level languages. Basically I have three questions:...
c# pointers vs IntPtr
c# pointers vs IntPtr this is the 2nd part of the 1st question [using c# pointers](https://stackoverflow.com/questions/4316639/using-c-pointers) so pointers in c# are 'unsafe' and not managed by the g...
C++ pointers simple question
C++ pointers simple question If I have the following lines inside a loop: or what is the behavior in what concerns to memory if I don't have delete operators inside it? It will be constantly allocatin...
- Modified
- 30 Apr at 14:58
int *array = new int[n]; what is this function actually doing?
int *array = new int[n]; what is this function actually doing? I am confused about how to create a dynamic defined array: I have no idea what this is doing. I can tell it's creating a pointer named ar...
- Modified
- 7 Jul at 19:21
C++ pointer to objects
C++ pointer to objects In C++ do you always have to initialize a pointer to an object with the `new` keyword? Or can you just have this too: I thought this was a pointer allocated on the stack instead...
Getting pointer for first entry in an array
Getting pointer for first entry in an array I want to get pointer of first entry in the array. This is how I tried Get following compilation error. Any ideas how to fix it? > You can only take the add...
- Modified
- 15 Jun at 23:48
What is the difference between const int*, const int * const, and int const *?
What is the difference between const int*, const int * const, and int const *? I always mess up how to use `const int*`, `const int * const`, and `int const *` correctly. Is there a set of rules defin...
make IntPtr in C#.NET point to string value
make IntPtr in C#.NET point to string value I am using a class which has `StringHandle` field which is an `IntPtr` value that represents a `LPCWSTR` in C++. say now that I have a String: `string x = "...
Pointer arithmetic for void pointer in C
Pointer arithmetic for void pointer in C When a pointer to a particular type (say `int`, `char`, `float`, ..) is incremented, its value is increased by the size of that data type. If a `void` pointer ...
- Modified
- 26 Apr at 18:21
What is the difference between delegate in c# and function pointer in c++?
What is the difference between delegate in c# and function pointer in c++? > [are there function pointers in c#?](https://stackoverflow.com/questions/2738850/are-there-function-pointers-in-c) I'm in...
- Modified
- 23 May at 12:31
C# memory management: unsafe keyword and pointers
C# memory management: unsafe keyword and pointers What are the consequences (positive/negative) of using the keyword in to use pointers? For example, what becomes of garbage collection, what are the p...
- Modified
- 22 Mar at 22:53
Meaning of "referencing" and "dereferencing" in C
Meaning of "referencing" and "dereferencing" in C I read different things on the Internet and got confused, because every website says different things. I read about `*` referencing operator and `&` d...
- Modified
- 25 Feb at 16:3
How can I initialize an array of pointers to structs?
How can I initialize an array of pointers to structs? Is it possible to initialize an array of pointers to structs? Something like: I want to do that in order to get the entities in not-contiguous mem...