pointer-to-pointer Questions

2

Solved

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. ...
Busra asked 10/11, 2017 at 11:48

14

Solved

I'm new to C with a good background in java and I'm trying to understand pointers and arrays. I know that subscript operator[] is part of an array definition, so: int numbers[] = {1,3,4,5}; ...
Knight asked 26/1, 2016 at 18:49

2

Solved

I'm trying to understand when I need to use malloc when using multiple levels of pointers. For example, #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { ...
Involute asked 26/12, 2015 at 11:5

2

Solved

So, i was playing with C pointers and pointer arithmetic since i'm not entirely comfortable with them. I came up with this code. char* a[5] = { "Hi", "My", "Name", "Is" , "Dennis"}; char** aPtr = ...
Froebel asked 1/6, 2015 at 17:40

5

Solved

I have a problem with the pointers. I know what this does: *name I understand that this is a pointer. I've been searching but I do neither understand what this one does nor I've found helpful ...
Vintager asked 17/4, 2015 at 7:32

2

Solved

If I have a 2d array B defined as : int B[2][3] = {{1,3,5},{2,4,6}}; Is int **p = B same as int (*p)[3] = B ? int **f = B; printf("%d ",*f+1); gives 5 as output while printf("%d ",*f) gives 1 ...
Snell asked 1/8, 2014 at 12:35

4

Solved

I'm am trying to write a program that reads in a series of strings from a text file and stores these in an array of strings, dynamically allocating memory for each element. My plan was to store eac...
Lelialelith asked 28/9, 2013 at 15:40

7

Solved

int num = 45,*ptr1,*ptr2; ptr1=# ptr2=&ptr1; printf("%d\n",*ptr1); I've been thinking about this question for a while, but couldn't find a way to understand it,why &ptr1 can not b...
Conaway asked 16/7, 2013 at 14:57

2

Solved

When you create the multi-dimensional array char a[10][10], according to my book it says you must use a parameter similar to char a[][10] to pass the array to a function. Why must you specify the...
Bungle asked 5/4, 2011 at 20:53

4

Solved

I want to change member of structure under double pointer. Do you know how? Example code typedef struct { int member; } Ttype; void changeMember(Ttype **foo) { //I don`t know how to do it //m...
Manzano asked 6/12, 2008 at 20:28
1

© 2022 - 2024 — McMap. All rights reserved.