Gang Of Coders
Home
About Us
Contact Us
All Pointers Solutions on Gang of Coders
Total of 288 Pointers Solutions
NULL pointer with boost::shared_ptr?
C++
Boost
Null
Pointers
Shared Ptr
C++ Array of pointers: delete or delete []?
C++
Arrays
Pointers
Delete Operator
How to create two classes in C++ which use each other as data?
C++
Class
Pointers
Header Files
Why is the dereference operator (*) also used to declare a pointer?
C++
Pointers
Syntax
Dereference
Notation
Why would code explicitly call a static method via a null pointer?
C++
Pointers
Static Members
Undefined Behavior
Dereference
Do all pointers have the same size in C++?
C++
Pointers
Language Lawyer
Void Pointers
What does malloc(0) return?
C
Linux
Pointers
Malloc
Realloc
Does Java have pointers?
Java
Pointers
X does not implement Y (... method has a pointer receiver)
Pointers
Go
Methods
Interface
Why does the arrow (->) operator in C exist?
C
Pointers
Dereference
Function pointers and address of a function
C
Function
Pointers
Function Pointers
dereferencing a pointer when passing by reference
C++
Pointers
Reference
initial value of reference to non-const must be an lvalue
C++
Pointers
Reference
How to get the pointer of return value from function call?
Pointers
Go
Printing pointers in C
C
Pointers
Placement of the asterisk in Objective-C
Objective C
Pointers
Simulating Pointers in Python
Python
Pointers
Function pointer as a member of a C struct
C
Function
Pointers
What is the difference between far pointers and near pointers?
C
Pointers
What is uintptr_t data type
C++
Pointers
Types
Differences between unique_ptr and shared_ptr
C++
Pointers
C++11
Shared Ptr
Unique Ptr
In C, are arrays pointers or used as pointers?
C
Arrays
Pointers
How to print variable addresses in C?
C
Pointers
Memory Address
Increment void pointer by one byte? by two?
C++
C
Pointers
C/C++ int[] vs int* (pointers vs. array notation). What is the difference?
C++
C
Arrays
Pointers
Standards
Dereferencing a pointer to 0 in C
C
Pointers
Memory
Dereference
Why can't the interface be implemented with pointer receivers
Pointers
Interface
Go
Array-syntax vs pointer-syntax and code generation?
C
Arrays
Pointers
Pointer Arithmetic
Errata
Arrow operator (->) usage in C
C
Pointers
Syntax
What is double star (eg. NSError **)?
C
Objective C
Cocoa
Pointers
Multiple Indirection
How do I create an array of pointers?
C++
Arrays
Pointers
Smart pointers/safe memory management for C?
C
Memory
Pointers
C99
Smart Pointers
Should I explicitly cast malloc()'s return value?
C
Pointers
Casting
How to include a dynamic array INSIDE a struct in C?
C
Pointers
Arrays
Struct
Memory Management
When is it valid to access a pointer to a "dead" object?
C
Pointers
Language Lawyer
Undefined Behavior
Pointers as keys in map C++ STL
C++
Pointers
Map
Stl
How to printf a memory address in C
C
Pointers
Printf
Memory Address
Unary Operator
Does the C standard permit assigning an arbitrary value to a pointer and incrementing it?
C
Pointers
Language Lawyer
Pointer Arithmetic
Is there any reason to check for a NULL pointer before deleting?
C++
Pointers
Null
Delete Operator
Pointer vs Variable speed in C++
C++
Performance
Variables
Pointers
Arrow Operator vs. Dot Operator
C
Pointers
Structure
clearing a vector of pointers
C++
Pointers
Memory Leaks
Vector
Write-Only pointer type
C++
C
Pointers
Readonly
Const Correctness
Using C-string gives Warning: "Address of stack memory associated with local variable returned"
C++
Pointers
C Strings
Invoking struct function gives "cannot refer to unexported field or method"
Pointers
Struct
Go
Why are `&array` and `array` pointing to the same address?
C++
Arrays
Pointers
Is it possible to get a pointer to one subobject via a pointer to a different, unreleated subobject?
C++
Pointers
Language Lawyer
C++17
Offsetof
What is the difference between str==NULL and str[0]=='\0' in C?
C
Pointers
Gcc
Cstring
Why does printing a pointer print the same thing as printing the dereferenced pointer?
Pointers
Rust
Dereference
How to cast self to UnsafeMutablePointer<Void> type in swift
Swift
Pointers
Casting
Unsafe Pointers
Pointer to class data member "::*"
C++
Class
Pointers
C++ Faq
How expensive is it to dereference a pointer?
C++
Pointers
What does this error mean: "error: expected specifier-qualifier-list before 'type_name'"?
C++
C
Pointers
Struct
What is ** in C++?
C++
Pointers
Are all data pointers the same size in one platform for all data types?
C
Pointers
Types
Should one really set pointers to `NULL` after freeing them?
C
Pointers
Free
A pointer to 2d array
C++
Arrays
Pointers
Multidimensional Array
What is the difference between char a[] = ?string?; and char *p = ?string?;?
C++
Pointers
Address of a temporary in Go?
Pointers
Return
Go
Temporary
Rvalue
My char pointer points to invalid value after being cast from int*
C
Arrays
Pointers
Pointer arithmetics with two different buffers
C++
Pointers
Language Lawyer
Pointer Arithmetic
NULL vs nullptr (Why was it replaced?)
C++
Pointers
Null
Nullptr
Class members that are objects - Pointers or not? C++
C++
Memory
Pointers
Class Design
Member
Does dereferencing a pointer make a copy of it?
C++
Pointers
Dereference
Reference to non-static member function must be called
C++
Pointers
Reference
Different Pointer Arithmetic Results when Taking Address of Array
C
Pointers
Language Lawyer
Return array in a function
C++
Arrays
Pointers
Function
Return
Pointer vs. Reference
C++
Variables
Pointers
Reference
What is the difference between char array and char pointer in C?
C
Arrays
Pointers
How to pass objects to functions in C++?
C++
Pointers
Pass by-Reference
Pass by-Value
C++ Faq
Are there benefits of passing by pointer over passing by reference in C++?
C++
Pointers
Parameter Passing
Pass by-Reference
size_t vs. uintptr_t
C
Pointers
Size T
Is the sizeof(some pointer) always equal to four?
C++
C
Pointers
Memory
Sizeof
Is an array name a pointer?
C
Arrays
Pointers
Passing by reference in C
C
Pointers
Pass by-Reference
Which kind of pointer do I use when?
C++
Pointers
C++11
Smart Pointers
C++ Faq
Correct format specifier to print pointer or address?
C
Pointers
Format
Memory Address
Should I use static_cast or reinterpret_cast when casting a void* to whatever
C++
Pointers
Static Cast
Reinterpret Cast
Why is the asterisk before the variable name, rather than after the type?
C
Pointers
Variables
Naming Conventions
Difference between char* and const char*?
C
Pointers
Constants
Constant pointer vs Pointer to constant
C
Pointers
Constants
How come an array's address is equal to its value in C?
C
Pointers
Arrays
What exactly is a C pointer if not a memory address?
C
Pointers
Memory Address
What are the differences between a pointer variable and a reference variable in C++?
C++
Pointers
Reference
C++ Faq
Why is 'this' a pointer and not a reference?
C++
Pointers
Reference
This
C++ Faq
C isn't that hard: void ( *( *f[] ) () ) ()
C
Parsing
Pointers
Function Pointers
Void Pointers
How do pointer-to-pointers work in C? (and when might you use them?)
C
Pointers
Returning an array using C
C
Arrays
Pointers
Char
Can I use if (pointer) instead of if (pointer != NULL)?
C++
Pointers
If Statement
Null
Null Pointer
Value receiver vs. pointer receiver
Function
Pointers
Go
What do people find difficult about C pointers?
C
Pointers
How to cast/convert pointer to reference in C++
C++
Pointers
Casting
Reference
Type Conversion
Is it good practice to NULL a pointer after deleting it?
C++
Pointers
Null
Dynamic Allocation
How do you pass a function as a parameter in C?
C
Function
Pointers
Syntax
Parameters
In C, why do some people cast the pointer before freeing it?
C
Pointers
Casting
Should I store entire objects, or pointers to objects in containers?
C++
Stl
Pointers
How do I do a literal *int64 in Go?
Pointers
Go
Struct
Literals
Function Pointers in Java
Java
Pointers
Delegates
Function Pointers
Why do C++ libraries and frameworks never use smart pointers?
C++
Pointers
Smart Pointers
"<type> is pointer to interface, not interface" confusion
Pointers
Go
Interface
C: differences between char pointer and array
C
Arrays
Pointers
What's the point of const pointers?
C++
C
Pointers
Constants
constant pointer vs pointer on a constant value
C
Pointers
Constants
Declaring pointers; asterisk on the left or right of the space between the type and name?
C++
C
Pointers
When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?
C++
Pointers
Casting
C++ Faq
Why is x[0] != x[0][0] != x[0][0][0]?
C++
Arrays
Pointers
C pointers : pointing to an array of fixed size
C
Pointers
Size
How does delete[] know it's an array?
C++
Arrays
Pointers
New Operator
Delete Operator
Pointer expressions: *ptr++, *++ptr and ++*ptr
C++
C
Pointers
Increment
What does `dword ptr` mean?
Assembly
X86
Dword
Pointers
Pointer to pointer clarification
C
Pointers
Pointers in Python?
Python
Pointers
How to explain C pointers (declaration vs. unary operators) to a beginner?
C
Pointers
Passing references to pointers in C++
C++
Pointers
Reference
Does free(ptr) where ptr is NULL corrupt memory?
C
Pointers
Memory Management
Null
Free
What does "dereferencing" a pointer mean?
C++
C
Pointers
Dereference
How can I use pointers in Java?
Java
Pointers
Unsafe
What exactly is nullptr?
C++
Pointers
C++11
Nullptr
Why are function pointers and data pointers incompatible in C/C++?
C++
C
Pointers
Function Pointers
Can't understand this way to calculate the square of a number
C
Arrays
Pointers
C99
Variable Length-Array
Why does the use of 'new' cause memory leaks?
C++
Pointers
Memory Leaks
New Operator
C++ Faq
What does Visual Studio do with a deleted pointer and why?
C++
Pointers
Visual Studio-2012
Memory Management
Delete Operator
Create a pointer to two-dimensional array
C
Arrays
Pointers
error: ‘NULL’ was not declared in this scope
C++
Gcc
Pointers
Null
Should I use char** argv or char* argv[]?
C
Arrays
Pointers
Standards
Pointers, smart pointers or shared pointers?
C++
Pointers
Why aren't pointers initialized with NULL by default?
C++
Memory
Pointers
Initialization
Why is address zero used for the null pointer?
C++
C
Memory
Pointers
What can I use instead of the arrow operator, `->`?
C++
Pointers
How to declare std::unique_ptr and what is the use of it?
C++
Pointers
Std
Unique Ptr
Difference between *ptr += 1 and *ptr++ in C
C
Pointers
Post Increment
What is the difference between std::reference_wrapper and a simple pointer?
C++
Pointers
C++11
Reference
Reference Wrapper
Why do linked lists use pointers instead of storing nodes inside of nodes
C++
Pointers
Linked List
Why does this code segfault on 64-bit architecture but work fine on 32-bit?
C
Pointers
Segmentation Fault
Range references instead values
Pointers
Reference
Go
What is a "fat pointer"?
Pointers
Rust
Can I call memcpy() and memmove() with "number of bytes" set to zero?
C++
C
Pointers
Memcpy
Memmove
How to increment a pointer address and pointer's value?
C
Pointers
What's the point of having pointers in Go?
Pointers
Go
Placement of the asterisk in pointer declarations
C++
C
Pointers
Declaration
Reason to Pass a Pointer by Reference in C++?
C++
Pointers
Reference
Typedef function pointer?
C++
C
Pointers
Typedef
What makes this usage of pointers unpredictable?
C++
Pointers
Deleting a pointer in C++
C++
Pointers
Delete Operator
How do I use arrays in C++?
C++
Arrays
Pointers
Multidimensional Array
C++ Faq
What is a smart pointer and when should I use one?
C++
Pointers
C++11
Smart Pointers
C++ Faq
C pointer to array/array of pointers disambiguation
C
Arrays
Pointers
Variable Declaration
In Go HTTP handlers, why is the ResponseWriter a value but the Request a pointer?
Pointers
Go
C# Store functions in a Dictionary
C#
Function
Pointers
Dictionary
Correct way of declaring pointer variables in C/C++
C++
C
Pointers
Coding Style
How to compare pointers?
C++
Pointers
What is the point of function pointers?
C++
C
Function
Pointers
C++ Faq
Can a pointer to base point to an array of derived objects?
C++
Pointers
Testing pointers for validity (C/C++)
C++
C
Validation
Pointers
Null
Difference between function arguments declared with & and * in C++
C++
Function
Pointers
Pass by-Reference
How does free know how much to free?
C
Size
Pointers
Free
Is it good practice to free a NULL pointer in C?
C
Pointers
Memory Management
error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’
C++
Pointers
Reference
Are Python variables pointers? Or else, what are they?
Python
Pointers
Variables
Identifier
How many levels of pointers can we have?
C++
C
Pointers
Language Lawyer
Limit
Is it possible to initialize a C pointer to NULL?
C
Pointers
Initialization
What is the difference between a C# Reference and a Pointer?
C#
Pointers
Reference
What are the barriers to understanding pointers and what can be done to overcome them?
C++
C
Pointers
What is array to pointer decay?
C++
C
Arrays
Pointers
What is an opaque pointer in C?
C
Pointers
Opaque Pointers
C++ pass an array by reference
C++
Arrays
Pointers
Reference
Pass by-Reference
Pointers vs. values in parameters and return values
Pointers
Go
Meaning of int (*) (int *) = 5 (or any integer value)
C++
Pointers
Function Pointers
Regular cast vs. static_cast vs. dynamic_cast
C++
Pointers
Casting
Why should I use a pointer rather than the object itself?
C++
C++11
Pointers
C++ Faq
Is it a good idea to typedef pointers?
C++
C
Pointers
Typedef
Conventions
Understanding and relationship between Box, ref, & and *
Pointers
Rust
When to use references vs. pointers
C++
Pointers
Reference
How is "int* ptr = int()" value initialization not illegal?
C++
Visual C++
Pointers
Initialization
Built in-Types
Why are references not reseatable in C++
C++
Pointers
Reference
Language Design
Is a pointer with the right address and type still always a valid pointer since C++17?
C++
Pointers
C++14
Language Lawyer
C++17
Checking if a pointer is allocated memory or not
C
Pointers
Why use pointers?
C++
C
Pointers
Why is a point-to-volatile pointer, like "volatile int * p", useful?
C
Pointers
Volatile
Meaning of *& and **& in C++
C++
Pointers
Syntax
Reference
Symbols
const char* and char const* - are they the same?
C++
Pointers
Constants
"int *nums = {5, 2, 1, 4}" causes a segmentation fault
C
Arrays
Pointers
Addresses of two char pointers to different string literals are same
C
Pointers
Literals
How to convert const char* to char* in C?
C
Pointers
Const Char
Print the address or pointer for value in C
C
Pointers
Memory Address
Does 'auto' type assignments of a pointer in c++11 require '*'?
C++
Pointers
C++11
Auto
What are the rules for casting pointers in C?
C
Pointers
Casting
Reference type in C#
C#
.Net
Pointers
What does P::************ mean in Boost assert.hpp file?
C++
Pointers
Boost
C++: difference between ampersand "&" and asterisk "*" in function/method declaration?
C++
Pointers
Reference
Passing a 2D array to a C++ function
C++
Arrays
Pointers
Multidimensional Array
Why are NULL pointers defined differently in C and C++?
C++
C
Pointers
Null
Exceptions to array decaying into a pointer?
C
Arrays
Pointers
How to convert a 'string pointer' to a string in Golang?
String
Pointers
Go
Type Conversion
Can I use NULL as substitution for the value of 0?
C++
C
Pointers
Null
Language Lawyer
Is NULL always false?
C
Null
Pointers
C Programming: malloc() inside another function
C
Function
Pointers
Malloc
increment value of int being pointed to by pointer
C
Pointers
Increment
Post Increment
When to use pointers in C#/.NET?
C#
.Net
Performance
Pointers
Unsafe
Does const-correctness give the compiler more room for optimization?
C++
C
Pointers
Constants
Const Correctness
With arrays, why is it the case that a[5] == 5[a]?
C
Arrays
Pointers
Pointer Arithmetic
What is the difference between const int*, const int * const, and int const *?
C++
C
Pointers
Constants
C++ Faq
How does dereferencing of a function pointer happen?
C++
C
Pointers
Function Pointers
When is an integer<->pointer cast actually correct?
C++
C
Pointers
Casting
Passing pointers between C and Java through JNI
Java
Pointers
Java Native-Interface
Cuda
How to use an iterator?
C++
Pointers
Vector
Iterator
Using Statement
What exactly is meant by "de-referencing a NULL pointer"?
C
Pointers
What is the function of an asterisk before a function name?
C
Function
Pointers
Duplicating objects in Java
Java
Variables
Object
Pointers
Reference
Meaning of "referencing" and "dereferencing" in C
C
Pointers
Reference
Dereference
Why not use pointers for everything in C++?
C++
Pointers
Heap Memory
Stack Memory
How to avoid memory leaks when using a vector of pointers to dynamically allocated objects in C++?
C++
Stl
Pointers
Vector
Derived
What is the size of a pointer?
C++
Pointers
Sizeof
Why doesn't polymorphism work without pointers/references?
C++
Pointers
Polymorphism
Virtual
Pointers to pointers vs. normal pointers
C
Pointers
Deleting Objects in JavaScript
Javascript
Pointers
Object
Memory Management
Garbage Collection
Why can a string be assigned to a char* pointer, but not to a char[] array?
C
String
Pointers
Initialization
Reusability
How to access the contents of a vector from a pointer to the vector in C++?
C++
Pointers
Vector
how does the ampersand(&) sign work in c++?
C++
Pointers
Reference
Ampersand
How to find the 'sizeof' (a pointer pointing to an array)?
C
Arrays
Pointers
Sizeof
Pointers in C: when to use the ampersand and the asterisk?
C
Pointers
Difference between passing array, fixed-sized array and base address of array as a function parameter
C++
Arrays
Pointers
Pointer values are different but they compare equal. Why?
C++
Pointers
Multiple Inheritance
Is it legal to compare dangling pointers?
C++
Pointers
Language Lawyer
Dangling Pointer
difference between a pointer and reference parameter?
C++
Pointers
Reference
Object Slicing
Returning a pointer to a vector element in c++
C++
Pointers
Containers
Iterator
gsl::not_null<T*> vs. std::reference_wrapper<T> vs. T&
C++
Pointers
Cpp Core-Guidelines
Guideline Support-Library
How can I get the size of an array from a pointer in C?
C
Memory Management
Pointers
Malloc
What is the reason for using a double pointer when adding a node in a linked list?
C
Pointers
Linked List
Pointer to incomplete class type is not allowed
C++
List
Class
Pointers
Iterator
What is the difference between returning a char* and a char[] from a function?
C
String
Pointers
How do I modify a pointer that has been passed into a function in C?
C
Function
Pointers
Parameters
Pass by-Value
What's the difference between a null pointer and a void pointer?
C
Pointers
When should I use raw pointers over smart pointers?
C++
Pointers
Boost
Smart Pointers
Length of array in function argument
C
Pointers
what's the point of std::unique_ptr::get
C++
C++11
Pointers
Unique Ptr
What is the difference between NULL, '\0' and 0?
C
Pointers
Null
Post-increment on a dereferenced pointer?
C
Pointers
Operator Precedence
Pointer to a map
Pointers
Dictionary
Go
How can I check if char* variable points to empty string?
C
Pointers
Char
Free memory allocated in a different function?
C
Pointers
Memory Management
Malloc
Free
C++ inserting unique_ptr in map
C++
Pointers
Map
Stl
Unique Ptr
Are there pointers in javascript?
Javascript
Pointers
Does Function pointer make the program slow?
C
Pointers
Function Pointers
Why do some people prefer "T const&" over "const T&"?
C++
Syntax
Pointers
Reference
Types
Javascript pointer/reference craziness. Can someone explain this?
Javascript
Pointers
Reference
Dot (".") operator and arrow ("->") operator use in C vs. Objective-C
Objective C
C
Pointers
Dot Operator
Is NULL always zero in C?
C
Pointers
Null
Zero
What happens to memory after '\0' in a C string?
C
String
Pointers
Malloc
C Strings
How to get the real and total length of char * (char array)?
C++
C
Arrays
Pointers
Char
Are pointers considered a method of calling by reference in C?
C
Pointers
Pass by-Reference
When to use pointers
Pointers
Struct
Go
Are there any platforms where pointers to different types have different sizes?
C
Pointers
Sizeof
Proper way of casting pointer types
C++
Pointers
Casting
Reinterpret Cast
Static Cast
Efficiency: arrays vs pointers
C
Arrays
Pointers
Performance
Memory Access
Declaring array of int
C++
Arrays
Pointers
Initialization
What is a dangling pointer?
C++
Pointers
Dangling Pointer
Dynamically allocating an array of objects
C++
Memory Management
Pointers
Destructor
Copy Constructor
Function pointer as parameter
C++
Function
Pointers
Function Pointers
C++ Returning Pointers/References
C++
Pointers
Return
What is the difference between char * const and const char *?
C
Pointers
Constants
Using pointers to remove item from singly-linked list
C
Pointers
Linked List
C vs C++ struct alignment
C++
C
Pointers
Struct
Object Layout
What does "int* p=+s;" do?
C++
Arrays
Pointers
Unary Operator
Determine the size of a C++ array programmatically?
C++
Arrays
Pointers
Memory Management
Is it possible to store the address of a label in a variable and use goto to jump to it?
C
Pointers
Label
Goto
Memory Address
Checking if this is null
C++
Pointers
Null
When should I use the new keyword in C++?
C++
Pointers
Reference
New Operator
Keyword
How do I properly map a `MagImageScalingCallback` using JNA?
Java
Pointers
Winapi
Jna
In C, how would I choose whether to return a struct or a pointer to a struct?
C
Pointers
Struct
Malloc
Convert iterator to pointer?
C++
Stl
Pointers
Vector
Iterator
Is it safe to delete a NULL pointer?
C++
Pointers
Memory Management
Null Pointer
Delete Operator
How to access a local variable from a different function using pointers?
C++
C
Pointers
Local Variables
Why use double indirection? or Why use pointers to pointers?
C
Pointers
Crash or "segmentation fault" when data is copied/scanned/read to an uninitialized pointer
C
Pointers
Segmentation Fault
Why does C++11 contain an odd clause about comparing void pointers?
C++
C++11
Pointers
Language Lawyer
Comparison Operators
What does ((void (*)())buf)(); mean?
C
Function
Pointers
Function Pointers
Why can't I convert 'char**' to a 'const char* const*' in C?
C
Pointers
Constants
Const Correctness
Pointer Arithmetic
C
Pointers
Pointer Arithmetic
Are there pointers in php?
Php
Pointers
Difference between pointer to a reference and reference to a pointer
C++
Memory
Pointers
Reference
In C, what does a variable declaration with two asterisks (**) mean?
C
Pointers
How to assign pointer address manually in C programming language?
C
Memory
Pointers
Changing address contained by pointer using function
C
Function
Pointers
cpp / c++ get pointer value or depointerize pointer
C++
Pointers
Hiding nil values, understanding why Go fails here
Pointers
Go
Interface
Null
C: pointer to struct in the struct definition
C
Struct
Pointers
Could I ever want to access the address zero?
C++
C
Memory
Pointers