Skip to main content

All Questions

1 vote
4 answers
102 views

char * gives garbage value when pointing to a variable of a function in C

When i pass a pointer to a function and then change the pointer to a another location of the memory, I get SIGSEV or garbage values. Where is a code to demonstrate that: #include <stdio.h> void ...
Mubin Muhammad's user avatar
2 votes
2 answers
115 views

why do I need to add an & sign while allocating a memory space inside a functions? [duplicate]

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
0 votes
3 answers
129 views

How to understand secondary pointer?

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
16 votes
2 answers
6k views

Why the second argument to pthread_join() is a **, a pointer to a pointer?

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