Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
3 replies
89 views

I'm in C and I have an int ** (2 dimensional array, it's basically a matrix, it's actually set up a little bit complicated but there's no internal aliasing, so it's not relevant). is this int** ...
Snark's user avatar
  • 1,674
3 votes
4 answers
143 views

I have a small project (ed-like text editor for myself. Just want to edit some config files using it) and I have some problems with it. workspace_file->flc = malloc(sizeof(char *)); ...
Ho1Ai's user avatar
  • 39
0 votes
3 answers
130 views

In trying to understand pointers, I created a M[x][y] array, a pointer to said array *p_M[x] and a pointer to said pointer **d_p_M. The first pointer points to the first element of a row in the array ...
pasty guacamole's user avatar
0 votes
0 answers
65 views

Why not double pointer to take an array? I'm having a bit of problem understanding why an array isn't passed as a double pointer (a pointer to a pointer) since the array name itself is a pointer (...
Hannibal.Br's user avatar
2 votes
2 answers
132 views

I wanted to try making an allocate function for a cell in a list, but when using it inside another functions, I need to add an "&" sign I am aware of what "&" means in c (...
nada 's user avatar
  • 33
1 vote
0 answers
82 views

I have to interact with a provided C library where one of the functions is declared as follows: int GetFileList(struct spiflash_file **ptr_spiflash_filelist, int **file_num); where **...
Marcomattia Mocellin's user avatar
1 vote
1 answer
256 views

I'm trying to write a trim function, but when I try to use it the compiler is giving me a runtime error or load of null pointer of type 'char' when I try to run this code: // Trim trailing whitespace ...
Debuholden's user avatar
-3 votes
2 answers
129 views

I am sending this message to clear my confusion that I could not manage and handle. The foo1 function code should work. I am giving the code details for you. When I run the code, the result is a ...
synapsis's user avatar
0 votes
1 answer
587 views

I have been trying to figure out how double pointer works with char * and char []. What I want to do is to assign a double pointer to the char * or char [] and then change the content. #include <...
Lucky Im's user avatar
0 votes
2 answers
67 views

#include <stdio.h> #define LENGTH 3 char *words[LENGTH]; int main( int argc, char *argv[] ) { char *pc; // a pointer to a character char **ppc; // a pointer to a pointer ...
ciphermute's user avatar
1 vote
2 answers
82 views

I know the difference between these two functions: Swap(int *x, int *y) vs Swap(int **x, int **y). But, I'm not sure how this kind of code works. How is it possible to swap the address which the ...
MatanCode's user avatar
1 vote
1 answer
215 views

I have to create a matrix with pointers in dynamic memory in C, fill it with random numbers then print it. This is part of a larger assignment from college (I had to do a whole library of functions ...
Frank S.'s user avatar
1 vote
1 answer
139 views

I have two options. receiving and processing pixel data in a flat array. If I choose it, I have to use single pointer. I have to use this code in every repeated pixel data process. int getIndex(int ...
Ssukdaebat60's user avatar
0 votes
1 answer
91 views

I'm trying to write a simple split function in c, where you supply a string and a char to split on, and it returns a list of split-strings: #include <stdio.h> #include <stdlib.h> #include &...
Sam van Kesteren's user avatar
0 votes
3 answers
136 views

i want to ask a question about pointer: void fun(const char** a) {...} 1. const char* b = nullptr; fun(&b); 2. const char** b = nullptr; fun(b); why use 1 but not 2? 1 is good, 2 donnot work
Yeatsflee's user avatar
0 votes
0 answers
28 views

about pointers in C++ why we use ** in pointer to pointer I just want to know the reason why we use ** in pointer to pointer what is the main reason of using double indirections ?what is the logic ...
Mpujara's user avatar
2 votes
4 answers
934 views

Am doing a task where am supposed to used getline function read input from a user from the terminal. Here is my code: int main(int ac, char **av) { printf("Write something: \n"); ...
user avatar
0 votes
1 answer
142 views

I m trying to insert a node at the beginning of a circular linked list using a void function. When i pass pointer to pointer head in the function because i have to change the head itself, it is ...
Neilson Programmer's user avatar
0 votes
2 answers
555 views

So i am new to programming and i have this program that i have to write, it has an array of integers and i have to pass it to a function with a pointer and then with a double pointer. After i wrote ...
Cromocon's user avatar
0 votes
0 answers
142 views

#include <iostream> struct Adder { int a, b; int operator()() { // member function. return a+b; } }; int main() { using MemFuncPtr = int(Adder::*)() ; alignas(64) char buf[64]; ...
tmal's user avatar
  • 97
0 votes
1 answer
54 views

In a bigger project i have been working on, i got an Segmentation fault (core dumped), so i managed to reproduce the problem like this: #include <stdio.h> #include <string.h> #include <...
iocode's user avatar
  • 59
1 vote
0 answers
54 views

I am trying to call external functions inside of a DLL from a Jython script using ctypes. The prototype is declared as: extern cl_error_t funcname(const char **varname) That's why I tried to create ...
askar's user avatar
  • 11
1 vote
2 answers
80 views

I'm building a program in C to run some simulations for my PhD research. Basically the program uses a function to read an input file with some important values, and then assign these values to ...
Luguecos's user avatar
  • 341
0 votes
1 answer
715 views

I am trying to load words from a text file into a binary search tree. Each line of the file contains one word. #include <stdio.h> #include <stdlib.h> #include <string.h> typedef ...
Anas Mostafa's user avatar
0 votes
0 answers
53 views

I recently wrote a MyStack class which would work just like STL stack. Now i decided to write MyStack struct, which I will work with using functions instead of methods struct Stack { int _data; ...
Miroigrin's user avatar

1
2 3 4 5