BinaryByter
but lets not teach him what pthread is 😉
Daniele°
did you link pthread? (rhetorical)
You Need to tell to rextester
BinaryByter
You Need to tell to rextester
rextester is not made for this
olli
You Need to tell to rextester
rextester might not support that
BinaryByter
anyway, i'm ready to get my third warn out for @vbextreme
BinaryByter
so you better move to #ot
BinaryByter
#ot
olli
linking and pthread are related to C++ so don't consider it ot
🐰🐾 سمیه
Best superspy, wanna be my partner?
what I'm supposed to do
Anonymous
Past tense? So now you really did?
🐰🐾 سمیه
in char **c, c is a pointer to a pointer to a char. correct?
olli
https://cdecl.org/
olli
in char **c, c is a pointer to a pointer to a char. correct?
char **c <=> declare c as pointer to pointer to char
🐰🐾 سمیه
So, why here if we want c to point to a[0], it should be used with double star, but for char *argv[ ], its elements point to strings with just a single star. for example *argv ponts to a string.
Anonymous
Participating in the icpc contest is not the most convenient way to write algorithms in C++ programming.
Anonymous
Is it?
Anonymous
What is the best book to learn C++?
Anonymous
I'm a beginner
olli
So, why here if we want c to point to a[0], it should be used with double star, but for char *argv[ ], its elements point to strings with just a single star. for example *argv ponts to a string.
**c dereferences a char (only single character) **argv dereferences a char (only single character) *argv dereferences a char* (string, multiple chars)
olli
What is the best book to learn C++?
https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
olli
why does the line numbering system look weird
locale settings.. probably the same as some countries writing from right to left
olli
could you please explain with some examples😅
char *s[] = { "Hello", "World" }; **s defeferences a char (the first letter of the first world => 'H') *s dereferences a char* (the first word => "Hello") *(*(s+1)+1) dereferences a char (the second letter of the second word => 'o') **(s+1) dereferences to char ('W') *(*s+1) dereferences to char ('e') *(s+1) dereferences to char*("World") == Ingoring const for simplicity ==
🐰🐾 سمیه
because I think [ ] is equivalent to *
🐰🐾 سمیه
and *s[1] derefrences to 'e', correct?
Daniele°
s[0][1]
Daniele°
here, could we declare string s like this: char **s = { "Hello", "World"};
char* s[2]={ [0] = "hello", [1] = "world" };
🐰🐾 سمیه
*s dereferences a char* (the first word => "Hello") this part is confusing
Daniele°
puts(s[0]);//hello putchar(s[1][0]);//w
Daniele°
puts(s[0]);//hello putchar(s[1][0]);//w
Now translate to pointer puts(*(s+0)); putchar(*(*(s+1)+0));
Daniele°
name[N] == *(name+N)
Daniele°
name[N][K] = *(*(name+N)+K)
Daniele°
int j = 1; int* p = &j; int** pp = &p; printf("%d %d %d", j, p[0], p[0][0] );
olli
and *s[1] derefrences to 'e', correct?
no, it's 'W'. First letter of the second word
🐰🐾 سمیه
😬
🐰🐾 سمیه
you're right
Daniele°
😅
Daniele°
I have wrong on precedence
🐰🐾 سمیه
*s dereferences a char* (the first word => "Hello")
🐰🐾 سمیه
this part, I think *s should dereference to a single char. but how it is dereferencing to an array of chars?
Daniele°
char* a[] You have an Array Witch contain a strings
Daniele°
each element of Array is address of string
Daniele°
typedef char* string; string a[]={.....};
🐰🐾 سمیه
Daniele°
😂
🐰🐾 سمیه
😆
Daniele°
what's typedef?
create a "new" type
Daniele°
typedef char* bad; bad C = "😡";
Francisco
what's typedef?
It's like an alias, but if you're in C++, you should use using instead of typedef
Ибраги́м
That;s one night, come back after another
🐰🐾 سمیه
That;s one night, come back after another
it's been 2 nights actually
Ибраги́м
Make it 3.
🐰🐾 سمیه
teach me, I wanto hack into sth 😆
🐰🐾 سمیه
Uh
yes, I want to hack into Russian ministeries
Ибраги́м
Ибраги́м
U see
Ибраги́м
There's this proverb: u can't spend 3 nights with a pointer problem except u solve it.
🐰🐾 سمیه
I can't😢
Ибраги́м
Are u saying pointer proverbs are lies ?
🐰🐾 سمیه
it's raaly a deadlock
Ибраги́м
it's raaly a deadlock
Never pray for a true deadlock, especially in C.
🐰🐾 سمیه
why
Ибраги́м
U'll know it when u have it.
🐰🐾 سمیه
ok, for now why don't you uncover this big mystery?