Menu
  • HOME
  • TAGS

String to linked list using double pointer

c,pointers,linked-list,double-pointer

There is a issue with your insert function in the first code snipper where you move the *head so by the time you insert the last node to the list the head is pointing to one before the last node a->b->c->d | | Head is at c now So you...

Typecasting a double pointer in C [duplicate]

c,casting,double-pointer

Use const while typecasting the datatype. myfunc((const my_char**)mydata); You are getting that value as a const in a function....

Why in C++ do I need to pass a pointer by reference to change the pointed content?

c++,pointers,double-pointer

You should pass pointers by reference if you have to modify the pointer rather than the object that the pointer is pointing to. Using double pointers is also a similar case. Here is a more detailed article: http://www.codeproject.com/Articles/4894/Pointer-to-Pointer-and-Reference-to-Pointer...

17653 Segmentation fault (core dumped)

pointers,malloc,openmp,double-pointer

void matrix_vector_gen(int size, double **matrix, double **matrix2){ int i,j; for(i=0; i<size; i++) for(j=0; j<size*size; j++) matrix[i][j] = ((double)rand())/5307.0; matrix2[i][j] = ((double)rand())/65535.0; } when you leave braces out only the next statement after the "for" statement is executed in the loop, so the "matrix2" line is executed after the loops end,...

Free a double pointer in C

c,arrays,pointers,free,double-pointer

double **Array2D (int ny, int nx, int dsize) { double **v; int j; for (j=0; j<ny; j++) v[j] = Array1D(nx, dsize); v object is never initialized in your function....

Compile time warnings double pointer in C language

c,pointers,struct,compiler-warnings,double-pointer

Look exactly at your struct declaration. You declare a typedef named directory. You do not anywhere declare a struct directory. But you are using "struct directory" inside the untagged struct that you declare. The compiler has no way to guess that you mean the typedef named "directory" when you write...

add value from file to double pointer [closed]

c++,file,input,fstream,double-pointer

The size of your matrix is wrong: matrix = new int *[edgeCount]; // wrong size wage = new int *[edgeCount]; // wrong size for (int i = 0; i < vertexCount; i++) { matrix[i]=new int[edgeCount]; wage[i]=new int[edgeCount]; } When you define the matrix you should use vertexCount instead, like this:...

modifying double pointer to an integer array

c,arrays,pointers,double-pointer

You should not do that because in this case there will be a memory leak because you already allocated memory for pointer array and the assignment will overwrite the value stored in the pointer. Write the function simpler void function(int **arr) { int *tmp = *arr; tmp[0]=1; tmp[1]=2; tmp[2]=3; tmp[3]=4;...