Anonymous
Why output is 1 0 1, Please explain
Javi
What do you find difficult to understand?
Anonymous
Why 1 0 1 came as output
MilkBeforeCereal
what do you think it should be
Javi
What does each line do?
Anonymous
Javi
Go line by line, what does each line do?
Javi
4 is wrong. That's not what it is
Javi
What does "int *parr[3]" mean?
Anonymous
Javi
No
Anonymous
array of pointer
Javi
It's an array of pointer
Javi
Yes
Anonymous
yes
Javi
So, what is "{arr1, arr2, arr3}"?
Anonymous
idk
Anonymous
not understood
Javi
If parr3 is an array of pointers, what is "{arr1, arr2, arr3}"?
Javi
I'll rephrase the question. If you do printf("%d", arr1), what do you print?
Javi
With no brackets
Anonymous
stored value of in arr1?
Javi
No
Javi
What is arr1, without any bracket?
Anonymous
variable
Javi
What type?
Anonymous
int
Javi
No
Anonymous
why, its not int
Anonymous
Javi
Yes, it's declared with brackets, which means that, with brackets, it's an array of ints. If you take the bracket out, what type of variable you end up with?
Anonymous
int because it declared
Javi
With brackets, what happens when you take the brackets out in an array variable?
Javi
If you print the value of "arr1" and the value of "arr1[0]", what do you get in each case?
Anonymous
Anonymous
Anonymous
and second one print value
Anonymous
of 0th position
Javi
So arr1 is...
Anonymous
pointer?
Javi
Exactly
Javi
And when you initialize parr3, you are doing it with 3 variables of type...
Anonymous
not understand
Anonymous
beacuse when I print using arr1 it print some big number but with parr 3 it print 010
Javi
Step by step
Javi
If you print arr1, you'll get an address because it's a pointer
Javi
If you print parr[0], you'll get the same, but you are not printing parr[0]
Javi
What are you really printing?
Anonymous
Anonymous
wait
Anonymous
not understand
Anonymous
i am confused in why *parr[i] printing 1 0 1
Javi
Ok, we have arrived, that parr is an array of pointers
Javi
So parr[0] is a pointer
Javi
Which pointer?
Anonymous
Javi
Here what?
Anonymous
Javi
What happens when you put * before a pointer?
Javi
What do you get with * before a pointer?
Mar!o
A duplet pointer
Mar!o
int a or int *b
Mar!o
or int* * duplet
Mar!o
A pointer pointing to a pointer
Javi
A duplet pointer
That's in a declaration. When you already declared a pointer, what do you get when you put a * before
Javi
Mar!o
You dereference it
Javi
Exactly
Anonymous
what?
Anonymous
pointer pointing to pointer?
Javi
No, forget about that
Mar!o
Anonymous
Mar!o
What is the type of the array parr?
Javi
Please, don't confuse him
Anonymous
yes so?
Anonymous