Anonymous
ok but why the position is in hex,but not bin or other?
Anonymous
the computer only knows bin numbers right?
BinaryByter
yes
Anonymous
but why it is in hex?
BinaryByter
that question is like 'why can my screen show me images if everythinf the computer krows are numbers'
Anonymous
i have the same question
BinaryByter
printf converts the value tho ascii characters before printing them
BinaryByter
i have the same question
your computer isn't showing you numbers. its converting them in order for your screen to understand those numbers
Anonymous
ok i see
BinaryByter
Maybe think of it like
BinaryByter
'why do you understand english even though its not your native language?'
Anonymous
i have the same question
Anonymous
thank you anyway
Anonymous
😄
BinaryByter
Sure
Luis José
i have the same question
All information, not only image but sound too, it's " splitted" to digital units. In the case of characters, there is the Ascii table (basic 255 chars) so 2^8=256, that's how you can store a character on a 8bits register. (I'm a native Spanish speaker, sorry if it's hard to read but I'm trying to pass my knowledge with you all)
Luis José
Even when the information its in fact stored in binary form, according to the kind of information it's convenient to manipulate it on other numeric system
Anonymous
Luis José
Anonymous
what will output in this code
Anonymous
#include <stdio.h>
int main(void){
int a = 1;
a = a++;
a=a++;
printf("%d",a);
}
Anonymous
it makes me confused
ThinkIt
just remeber X++ will first assign the value and then increase it and ++X wiil first increse the value then assign it
Anonymous
yes,but then second what is the value of the second" a=a++"
Anonymous
i thought it is 2
Anonymous
but it is 1
ThinkIt
see, during first a++ first value of a is assigned 1 and then incresed by 1 , so a is now 2
ThinkIt
during second a++ initially value of a is assigned 2 and then incresed by 1 , so a is now 3
Anonymous
yes i think so but the compiler says it is 1
ThinkIt
that is why during printting a is 3
Anonymous
it ia 1 in my computer
Anonymous
Anonymous
if not , run it , it is not 3 ,it is 1!
Anonymous
that's why i think its strange
ThinkIt
i ran the code and it is fine
olli
It's undefined behavior, so the compiler is free to do what it wants.
ThinkIt
output is 3
olli
Hence you can experience different results on different compilers
Anonymous
olli
Because the standard says so - in an expression variables may be updated at most once between sequence points. (side effect on scalar is unsequenced relative to other side effect on same scalar object) (C and C++17)
for an int i and int a[3] and function void f(int, int): f(i, ++i); and a[i] = ++i; are also UB
Anonymous
it seems make sence
ThinkIt
most of the online C compilers are giving 1 as output
ThinkIt
while my standard gnu gcc is showing output as 3
ThinkIt
Luis José
Anonymous
Hello guys
Anonymous
Any Indian in the house
Anonymous
Ok
Anonymous
Let us c++
Liam
olli
Liam
Why?
'cause the standard well-defines things like func(i, ++i), in C++17.
olli
Where?
Liam
Anyway, in real productive environment, one who writes this kind of codes is about to be smashed.
Liam
Where?
see eval_order page in cppreference:
https://en.cppreference.com/w/cpp/language/eval_order
Liam
Liam
Liam
That is, in C++17, some new sequenced-before rules are added to define the behavior of compilers and program compiled.
Liam
it makes me confused
Well, it'll not just confuse you, but will confuse anyone else.
Hence, from my engineering experience, self-increment/self-decrement operators (++i, i++, --i, i--) should only be used as a single expression. This is not a restrict rule from C++ standard, but just a rule from experience.
Following this rule, self-increment/self-decrement operators will have clear meaning and will never confuse anyone who is reading the snippet of code.
#include <stdio.h>
int main(void){
int a = 1;
a++;
a++;
printf("%d",a);
}
Forget the discussion about evaluation order in C++ standards above, and just remember that you writing codes for human reading, not for maching optimizing. The later thing is the work of compiler — trust your compiler, it'll do enough optimization for your program.
Liam
(in almost all cases)
Ksenia
Such an awesome group of developers!!!
Ksenia
Thanks for creating this chat!!!
Anonymous
Cplusplus for Professionals.
Ariana
#cppbook
Ariana
https://www.geometrictools.com/Documentation/IntersectionOfCylinders.pdf
So this states that -
A better alternative to a cylinder is a capsule, the set of points a specified distance from a line segment.
But isnt the end of a capsule curved instead of sharp like a cylinder? If so how would using a capsule be an alternative or maybe could somehow check if the intersection is at the end of a capsule and call it not a intersection?
Basically im running a simulation with like hundreds of cylinders so got to optimise as much as possible
Ariana
tfw when hardest part of the sim is finding when 2 particles collide
User
anyone can tell me how can i add members in my group with username
Dima
User
what is this?
Ariana
i need one for duckduckgo
Ariana
www.fuckingduckduckgoit.com
Ariana
aww
Anonymous
Please i need help with CARE 2X installation
Dima
Anonymous
Dima
oh, a new googleit response
Dima
ah, nah, it isn't