Pointers are variables themselves, so a pointer that points to another pointer is a pointer to pointer. A pointer to pointer is sometimes mistakenly referred to as "double pointer".
Questions tagged [pointer-to-pointer]
234 questions
0
votes
0 answers
**ft_split(char const *s, char c), segmentation fault
It is my 3rd file where I am trying to solve this function. Its task is to split the string *s with delimiter "c" and save it in new malloc. I am getting segmentation fault, gdb shows it happens after i get from line 57 (big = malloc...) to line 63…

Tony
- 25
- 1
- 6
0
votes
1 answer
C - Writing a struct into a 2D array causes Segmentation Fault
I'm trying to write a program that reads a text file into a 2D array of structs, but trying to put a struct into that array causes the program to crash.
Here's the program
ppm.c
#include "ppm.h"
#include
#include
#include…
0
votes
1 answer
Passing Dynamic Two Dimensional Array as argument to a functoin in c++
Hy guys, I actually Trying to create a 2D Array in c++ but not able to create that, When I execute the following statement
int arr=new int[10][10]
It gives me error and when I search on google it shows me 2D array in c++ is array of pointers which…

Vinay Kumar
- 674
- 2
- 9
- 21
0
votes
0 answers
python 3.9 x64 ctypes pass char pointer by reference (char**) OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF
First of all
This works perfectly in x32 python, but fails in x64 python with the following error
OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF
I got a hello.dll written in C++ which exports the following function
int __stdcall…

LPVOID
- 306
- 3
- 17
0
votes
1 answer
C: How do I check if a bi-dimensional array is empty and how to delete an element in sai array?
I have declared the array in this way:
static char **stack;
I have a function to push elements into the array/stack.
int push(const char *s) {
if (p >= stack + size)
return 0;
*p++ = (char *)s;
return 1;
}
Where
static char **p;
static…

bugs_and_stars
- 45
- 6
0
votes
1 answer
dynamic array of strings, but i get heap corruption detected
I try to make a dynamic array of char pointer, what means does pointers can be a dynamic memory too, so in the code above I try to allocate one size to the array and in him, allocate to the first object a string. But I get an error "heap corruption…

Artur Karabekov
- 17
- 3
0
votes
1 answer
Is accessing a double pointer array within a pointer array possible?
I'm trying to pull off the statement where the error is occurring in the code below.
I'm getting a segmentation fault whenever this statement is executed.
Is there something wrong with this statement?
Suppose,
struct StructX
{
int **…

oss
- 115
- 8
0
votes
1 answer
Double pointer with array in another function
I have to create a program that has an array of costumers (structs that contain name, code and documentation) and functions to insert, remove and list all of them in order of code. I'm not understanding what I should do. Please note that the…

Pedro R.
- 11
- 3
0
votes
0 answers
Split Function in Binary Search Tree Class C++
I am currently working on an assignment for a comp sci class that requires me to implement a bunch of different functions with binary search trees. The current function that I am having trouble wrapping my head around goes through the tree and…

Davis Weitzel
- 1
- 1
0
votes
2 answers
Dereferencing double pointers in C
For the given code below :
If we place name inside main, I get a segmentation fault. Why?
Can we print each element of the matrix using p?
Why does p++ jump by 8 bytes, while cp++ jumps to the next string?
char *name[] = {"Arza", "Homes"}; //NULL…
0
votes
1 answer
Where does the pointer "char **strData" point to?
From the code here there is the pointer char **strData = NULL; in line 12. I'm new to C and pointers. I get, that it is a pointer, which points to another pointer. I just don't see the other pointer.
Can somebody help me?

BeldCode
- 67
- 1
- 7
0
votes
2 answers
How to get rid of -Wpointer-arith
This code:
void Pack::packUInteger(void **buffer, unsigned int payload){
memcpy(*buffer, &payload, sizeof(unsigned int));
*buffer += sizeof(unsigned int);
}
yields this warning, that I would like to get rid off without telling the…

larslars
- 168
- 1
- 14
0
votes
2 answers
2d array memory management issue
I have to write a code that gets a string and turns it into an object of a class. Everything is working as expected but I'm unable to deallocate the dynamically allocated 2d array of objects.
I know the issue is within the destructor and the Move…

Yukikiru
- 33
- 1
- 4
0
votes
2 answers
Binary Tree deletion setting to NULL after freeing
I'm performing binary tree deletion in c.I was trying out few methods interestingly this weird situation came.
void Delete(){
struct BinaryTree* ptr = root;
int element;
printf("Enter element to delete : ");
scanf("%d",&element);
…

Sreyas
- 461
- 3
- 15
0
votes
2 answers
Remove element from a pointer and pointer to pointer in C
Still learning, this is a segment of code I'm working on and I'm trying to remove an element(s) from a pointer/pointer-pointer. The problem is near the end of the code.
int total, tempX = 0;
printf("Input total…

Bryan Rosen
- 35
- 5