Harsh
ברני
ברני
Ty 😊
V01D
Gcc compiles to pie (position independent executable)
The book I am reading describes it as a hacker safe feature.
Is PIE == ASLR?
Mohammad
Hello friends
Does anyone have a php programming group?
Thank you for sending me
V01D
Correct
Same with pie right?
V01D
Pie too
Anonymous
Hi
V01D
Yeah, np.
Thanks
Hermann
/get c++
Hermann
/getc++
Anonymous
Hermann
/get c++book
Anonymous
Anonymous
Anonymous
Anonymous
Anonymous
Anonymous
You're welcome
Anonymous
Ok
Anonymous
What is the difference between these three C compilers?
Which one is more powerful and widely used.
V01D
V01D
*The three mainstream compilers
V01D
int **ptr;
"ptr is a pointer to a pointer to an int."
Why would I do this.
Nisal
V01D
V01D
And why would that be useful?
V01D
why would I ever want to reference a pointer by itself
V01D
Thx
Vlad
Why lol? It is the same.
Vlad
Btw all arrays in the function declaration decay into pointers. Hence there's no "pass by value" semantic for arrays in C.
Jøhn
Vlad
Readability
It's even worse than egyptian brackets vs new line brackets controversy.
Vlad
It doesn't matter at all unless you've got a severe brain damage
Jøhn
K&R is incredibly outdated
V01D
char a3[3]="abc";/* a1 is char[3] holding {'a','b','c'}, missing the '\0' */
Isn't this false?
The char array isn't missing a \0 since arrays are zero indexed I thought..
V01D
a = 0, b = 1, c = 2, '\0' = 3
Vlad
V01D
Vlad
V01D
V01D
Size is 3.
But it is zero indexed, so technically it is four.
Vlad
Size is 3.
One shall not access array by the index < 0 || index > size-1
Anonymous
Thanks
Technically you can just do
int *ptr = something;
ptr = fn(ptr);
(fn returns the new pointer)
But this adds another alternative
Vlad
Vlad
Your array's capacity is 3 elements
V01D
int arr[2] = {10, 10, 10};
Why does this work then
Anonymous
Vlad
Vlad
Compiler will yell at ya, that the size doesn't not match init list
V01D
It doesn't
Uh...
Okay, but arrays are zero indexed.
To me, there are three elements if it is zero indexed.
0, 1, 2 -> that is three elements.
V01D
Wait I think I know
Vlad
V01D
They are zero indexed when I access them, NOT when I create them.
Vlad
It is exactly how many elems you can store
V01D
int arr[2] = {10, 10};
arr[0] = the first element
Vlad
Vlad
indexing is just *(arr + i)
V01D
Vlad
You just put size into brackets
V01D
Yeah, that's what I said
V01D
When I declare an array I specify it's size (which is NOT zero indexed)
When I access an element in the array it IS zero indexed
Vlad
V01D
Ya, okay
V01D
My terminology was off, but you know what I meant
V01D
The SIZE of an array does NOT start at zero when I INITIALIZE it
Vlad
Vlad
But you can't store anything within it
V01D
Yeah.
V01D
Okay, thanks for clearing my confusion
Anonymous
whats wrong in array rotation algorithm
Anonymous
practicing juggling algo.
Asuna 🍓
* Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed.
For posting long code snippets:
* [GitHub Gist](https://gist.github.com)
* [Ubuntu Paste](https://paste.ubuntu.com/)
* [Pastebin](https://pastebin.com)
Anonymous
ok