Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
545 views

I am new to C, I can't seem to find much on pointer pointer char for the purpose that I need it. Here's my code simplified: int total, tempX = 0; printf("Input total people:\n");fflush(stdout); scanf(...
Bryan Rosen's user avatar
0 votes
6 answers
1k views

I am learning c, and I am quite confused about this double pointer question. int x = 44; int *p = &x; int **t = &p; bool a = (*t = &x); I need to tell whether a will be true or false, ...
prelude38's user avatar
  • 119
1 vote
1 answer
97 views

I am working with GenICam library, one of the methods is described as follows: I am using this method to get camera frames. We must provide to pBuffer a pointer, the method will return to our pointer, ...
Alejandro's user avatar
0 votes
0 answers
32 views

How the memory allocation is done for a char pointer array and double pointer. char *s[]={"knowledge","is","power"}; char **p; p=s; cout<<++*p<<*p++<<++*p<<endl; In the ...
T.g's user avatar
  • 179
3 votes
1 answer
89 views

I am trying this code: int x[] = {1,5}; int y[] = {3,6}; int *w[] = {x,y}; int **z = w; printf("%d", **z[1]); cout<<**z[0]; But it doesn't work. My goal is to access to each element inside the ...
lovecode's user avatar
  • 4,021
0 votes
1 answer
75 views

So I have the following example in some lecture notes void f(int **p){} void g(int *p[]){} void h(int p[2][3]){} int main(){ int **a; allocate_mem(a); // allocate memory for a f(a); // OK! ...
HereBeeBees's user avatar
1 vote
1 answer
489 views

I'm making a program that reads in text from a file, delimits it into alphanumerical words, and so on. I'm running into an issue where, I've read from the file into a string, and I'm trying to delimit ...
DanBan's user avatar
  • 21
0 votes
2 answers
716 views

I have a char * that is a long string and I want to create a pointer to a pointer(or pointer array). The char ** is set with the correct memory allocated and I'm trying to parse each word from the ...
Jerum 's user avatar
  • 71
3 votes
3 answers
1k views

My function prototype is int** rotate(int **arr, int row, int col, int fl); where arr is the two dimensional array, row and col is the number of row and columns of the 2D array respectively, fl is a ...
SB56's user avatar
  • 27
16 votes
2 answers
7k views

I am new to using pthread and also not that familiar with pointers to pointers. Could somebody perhaps explain why the second argument of pthread_join() is a void **. Why is it designed like this. ...
artic sol's user avatar
  • 493
-6 votes
2 answers
120 views

int **arr = (int **)malloc(r * sizeof(int *)); how should i interpret the meaning of the above C code ?
user292174's user avatar
1 vote
2 answers
2k views

I know that you can use tables in a similar way to pointers in lua. That being said, what would pointers to pointers look like? Would they look something like dp = {p = {}}? if so what would the ...
Ace shinigami's user avatar
2 votes
2 answers
71 views

I'm trying to solve a problem for a web tutorial (non-marked) where I'm implementing a dynamic array. However, it fails in two places: Where I try to delete a dynamic array in function ...
user avatar
0 votes
0 answers
122 views

I have this following code: void pushInList(t_chan **chan, char *name, char *nick_user) { t_chan *new_channel; (void)nick_user; if ((new_channel = malloc(sizeof(t_chan))) == NULL)...
Oraekia's user avatar
  • 1,177
-3 votes
1 answer
55 views

I've been doing this as an exercise on my own to get better at C++ (messing around with a linked list I wrote). What I want to do is to reverse the list by twisting the pointers around, rather than ...
Zaeche's user avatar
  • 1
0 votes
1 answer
199 views

i have a console based application in which i am using pointer to a pointer. It is minesweeper game in which i need to create board using pointer to a pointer. I have to pass my this pointer to ...
user3768904's user avatar
0 votes
1 answer
6k views

char** splitInput = malloc(255 * sizeof(char*)); ... while(token != NULL) { splitInput[i] = token; token = strtok(NULL, " "); i++; } I don't know why this code works. In my previous ...
Hugo's user avatar
  • 129
1 vote
5 answers
143 views

I thought that if I create a pointer to array type, I will be able to print all of its elements. I wrote a program like this, #include <stdio.h> int main() { int arr[] = {4,2,3}; //...
acidlategamer's user avatar
1 vote
0 answers
70 views

I am having some trouble with pointers in C. Basically, we are tasked with programming an N-ary tree (family tree). Any single node can have any number of children (0, 1, 2, ...). I am stuck at the ...
Some Guy's user avatar
  • 411
1 vote
1 answer
103 views

I have this code: #include<stdio.h> #include<stdlib.h> struct node { int data; struct node *next; }; void pointerOfPointer(struct node **reference) { struct node *temporary =...
adipginting's user avatar
2 votes
3 answers
891 views

I want to allocate some memory to a pointer using a function. Following is the code I have written: #include <stdio.h> #include <stdlib.h> int test( unsigned char **q) { *q = (...
mk09's user avatar
  • 383
1 vote
4 answers
2k views

How can I deinitialize x inside the free_x function? I have to do it in order to fit to an API method. I can very easily deinitialize x just by assigning null to it but I have to do it inside the ...
sanchop22's user avatar
  • 2,829
0 votes
3 answers
12k views

struct node { struct node *next; int num; } Node; Node *insert(int i) { Node *head; for (int c = 0; c < i; c++) { head = malloc(sizeof(Node)); head.num = i; ...
P. Sate's user avatar
0 votes
1 answer
41 views

1. struct node { 2. char data; 3. struct node* nxtPtr; 4. } 5. 6. typedef struct node Node; 7. 8. Node* front = NULL; 9. Node* end = NULL; 10. 11. void enqueue(char userData) 12. { 13. ...
Philip Butler's user avatar
0 votes
1 answer
130 views

I can't figure out what is causing the issue. I get "access violation writing location" error in the last line. Am I not correctly allocating the memory? typedef struct { doubleXYZW cen_sum; ...
Nenu's user avatar
  • 59