ברני
Then afaik, you don't need any of that logic Just use a while loop checking each digit i. If digit even, evenDigitCount++ ii. Else continue
OK I'll try that, I sent a code my friend did, and he did there the math part that cunfuse me..
ברני
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++
Mohammad
@en_it_chats
Thank you ❤️
o
Ok, then maybe resources for c?
"effective C" by Robert C. Seacord is a great book, really great book!
Hermann
/get c++book
Anonymous
Anonymous
No
What?
Anonymous
What?
Write it yourself
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
*The three mainstream compilers
V01D
int **ptr; "ptr is a pointer to a pointer to an int." Why would I do this.
V01D
int **ptr; "ptr is a pointer to a pointer to an int." Why would I do this.
Like the main function has this too sometimes. int main(int argc, char** argv)
V01D
And why would that be useful?
V01D
why would I ever want to reference a pointer by itself
Alex
And why would that be useful?
1. change pointer inside function 2. allocate array of pointers
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.
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
Anonymous
int **ptr; "ptr is a pointer to a pointer to an int." Why would I do this.
To change the pointer itself. Example - passing the pointer to some function and making a realloc there.
Vlad
why
Size is 3.
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
V01D
One shall not access array by the index < 0 || index > size-1
But isn't this reasoning correct? a = 0, b = 1, c = 2, '\0' = 3
Vlad
Your array's capacity is 3 elements
V01D
int arr[2] = {10, 10, 10}; Why does this work then
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
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
indexing is just *(arr + i)
Vlad
So this is correct
You are not indexing them on creation
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
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
One too many times is not enough, ain't it? Indexing is getting the value from an array.
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
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