Dima
*(&lol)**ptr->cant->hear->you->**all->overThis++;
Daniele°
Daniele°
(&lol)[0].ptr[0].cant[0].blablabla
Ибраги́м
Ибраги́м
Daniele°
Daniele°
This is what u call lambda?
you can do better, but I live well even without it
🐰🐾 سمیه
again *s is char* and **s is char... yes the address of the char(s) are obv the same.
In that program, *s is a pointer that points to the first element of string literal "hello". And **s is a pointer that points to *s which points to the first element of "hello". Correct?
🐰🐾 سمیه
how is that?
BinaryByter
char ** => one pointer points to an array of chars
Daniele°
char a; char* b=&a; char** c =&b
Daniele°
char*** d=&c
Anonymous
🐰🐾 سمیه
It means his explanation is wrong?
BinaryByter
yes
🐰🐾 سمیه
yes
I thought that way
Anonymous
yes
Read again
BinaryByter
thats better
🐰🐾 سمیه
And that makes sense
🐰🐾 سمیه
No *s is char * (the first word) **s is not a pointer any more, it's char, the first letter
Previously you told me that char ** is a pointer to a pointer to a char, and on internet everyone are saying so. Why you say it's simply a char
Anonymous
yes
Is it possible to enter elements in array by recursion...not by for loop. I'm just trying to reduce complexity
🐰🐾 سمیه
hes talking about the twice dereferenced s
Why don't you say the correct explanation
BinaryByter
he did
Anonymous
No *s is char * (the first word) **s is not a pointer any more, it's char, the first letter
Bro..it's *s is a pointer..that stores address of element of char type
BinaryByter
No, *s is a once dereffered pointer
Anonymous
No, *s is a once dereffered pointer
You way of explanation is somehow complex.. You don't explain in simple language
olli
If you dereference a pointer to pointer to char once you get a pointer to char
olli
It's as easy as that
olli
If you dereference a pointer to pointer to char twice you get a char
olli
That's all I said
Anonymous
If you dereference a pointer to pointer to char twice you get a char
Okay..just tell me..if I print **s. Than what would it print
Anonymous
'h', a char
And if I print *s
Anonymous
?
olli
And if I print *s
Depends on how you print it
Anonymous
UB
Means..?
olli
And if I print *s
Could be a address or the word "hello"
olli
Means..?
Undefined behavior
BinaryByter
UB
Not UB in the traditional sense of "undefined by standard" (unless you really never allocate the string) but rather : "now knowable at runtime"
olli
This?
Yes, and the bigger example from yesterday
Anonymous
Could be a address or the word "hello"
Bro.. But *s should point to address of first char of string..
🐰🐾 سمیه
Yes, and the bigger example from yesterday
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 ==
🐰🐾 سمیه
This?
olli
Bro.. But *s should point to address of first char of string..
printf("%p", *s); what does this print?
olli
Anonymous
Wtf.. *s should print whole string..?
Anonymous
Hello
olli
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 ==
This - copying got rid of stars 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 ==
Anonymous
?
olli
Wtf.. *s should print whole string..?
Again what does this print? printf("%p", *s);
Anonymous
**s
Anonymous
Means h
Anonymous
I think
Anonymous
But not sure
olli
Yes and that's what I said above (regarding the h part)
Ибраги́м
olli
no
BinaryByter
/pardon @Landi58
Anonymous
y
BinaryByter
oh that works
BinaryByter
cool
Anonymous
Now...my question is . How to convert string into char array in C++
BinaryByter
string::c_str()
BinaryByter
next time, use google
Anonymous
string::c_str()
This I know.. But I want to do it manually..by my own logic