Anonymous
don't they just use LLVM nowadays?
borland/embarcadero. not dinosaurs
Anonymous
Strange. Later I will see it
Talula
don't they just use LLVM nowadays?
C++ Builder is not Borland C++, Borland C++ use to use OWL classes, C++ Builder is based on Delhi.
Nomid Íkorni-Sciurus
What does this mean? I know what | and « mean, but why would you write something like this?
Anonymous
I am having the following table and I need to get for each title the olders, someone can help me
Anonymous
Anonymous
the result should be something like this
Anonymous
klimi
Just read it line By line?
Anonymous
i need the query statement
Anonymous
don't they just use LLVM nowadays?
There are at least three good compilers: g++, MSVC, clang
Asad
metallica top
MengShu
What does this mean? I know what | and « mean, but why would you write something like this?
getc() reads a character from a file. This code snippet shows it reads 2 characters and uses | and << to convert them to be a short value.
Anonymous
I mean why is | necessary ?
It concatenates two one byte values in one two bytes value
Nomid Íkorni-Sciurus
Pavel
I think I'm confused
imagine you read first value 0xAB second value 0xCD then to concatenate them into a two byte value you would do the next shift the second one 8 bits left 0xCD << 8 that would result in 0xCD00 then merge them together 0xAB | 0xCD00 that will result in 0xCDAB where | - is bitwise OR
Nomid Íkorni-Sciurus
ah, right.
Nomid Íkorni-Sciurus
0xAB << 8 then
Pavel
0xAB << 8 then
(0xAB << 8) | 0xCD => 0xABCD parentheses because I'm not sure about the precedence
Nomid Íkorni-Sciurus
hm...
Nomid Íkorni-Sciurus
So, I see you wrote it little-endian, but actually speaking, isn't big-endian just more intuitive? I mean, why would we read the numbers in the opposite direction?
Pavel
should not be as I see parentheses are not needed https://en.cppreference.com/w/cpp/language/operator_precedence
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
I see many times data dumped little-endian but is there a reason for choosing it instead of big-endian?
MengShu
So, I see you wrote it little-endian, but actually speaking, isn't big-endian just more intuitive? I mean, why would we read the numbers in the opposite direction?
I think I got your point. You mean, if the value is 0xAB 0xCD, the code should be 0xAB « 8 | 0xCD. However, the code snippet you gave is opposite. Am I correct?
Pavel
I see many times data dumped little-endian but is there a reason for choosing it instead of big-endian?
you should choose whatever you target architecture is using (generally to make less byte swaps when implementing serialization/deserialization)
Nomid Íkorni-Sciurus
Killin
Guys
Killin
Anyone know websites which provide c programming questions and answers
Pavel
but I generally would prefer to have the same endiannes in data as my target architecture have
Nomid Íkorni-Sciurus
hm... I see, so there is no advantage into choosing one instead of another
MengShu
yes.
I think it may relate to Operator Precedence. https://en.cppreference.com/w/c/language/operator_precedence However, I will not write code like this...
MengShu
I think it may relate to Operator Precedence. https://en.cppreference.com/w/c/language/operator_precedence However, I will not write code like this...
I remembered that there was a message sent by @teiuq mentioned about this several minutes ago. But the message seems to be deleted.
Allji
hello, everyone. is it allowed here to ask some newbie questions?
Allji
my question data structure related, got stuck in one problem. want someone to explain me one thing
Anonymous
You can try
Allji
Allji
whats the logic here, how do i approach
Pavel
whats the logic here, how do i approach
Google "alpha-beta pruning algorithm", there are articles and videos describing it
Asad
which one is more popular: camelCase or underscore_case ?
Asad
i mean which one to choose as a beginner so that it will become a nice habit?
MᏫᎻᎯᎷᎷᎬᎠ
Ahhh
MᏫᎻᎯᎷᎷᎬᎠ
Just bear with the team/company style
Alion🦁
which one is more popular: camelCase or underscore_case ?
Camel case. But in web especially second one (for example, react)
MᏫᎻᎯᎷᎷᎬᎠ
Rust uses both
Nameful
Rust uses both
Doesn't it use PascalCase and snake_case?
Nameful
Where does it use camelCase?
Noor
New to C, how do I make generic type of growable array in C? especially with c11 _Generic thing.
Pavel
Where does it use camelCase?
Isn't PascalCase just another name to camelCase?
MᏫᎻᎯᎷᎷᎬᎠ
For structs: PascalCase Methods & functions: snake
Pavel
Because there are "upper" and "lower"...
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
camel starts with small
Nameful
Isn't PascalCase just another name to camelCase?
I've seen camelCase used to refer to both, but PascalCase only for starting with uppercase
Nameful
Personally I find it clearer to always call "upper CamelCase" PascalCase
MᏫᎻᎯᎷᎷᎬᎠ
Yeah
Noor
i mean which one to choose as a beginner so that it will become a nice habit?
What ever you find it nice, thing to consider - snake is really readable, but its easily run out of column. - camel is solve the column space but is not really readable as snale.
Pavel
What ever you find it nice, thing to consider - snake is really readable, but its easily run out of column. - camel is solve the column space but is not really readable as snale.
Readability is individual, after working a while with camelCase it's becoming almost the same readable as snake case (maybe except for issues with I/l, O/0 sometimes)
Nameful
Readability is individual, after working a while with camelCase it's becoming almost the same readable as snake case (maybe except for issues with I/l, O/0 sometimes)
Personally I found that even after using camelCase for everything for a good while, snake_case was a lot more readable
DanielQR
Thank you for the opinion about Borland Compiler. I recently started to try Embarcadero C++ Builder Berlin, it use that compiler,
MᏫᎻᎯᎷᎷᎬᎠ
It's a bad idea to overuse static_cast because of code-bloat, right?
Francisco
It's a bad idea to overuse static_cast because of code-bloat, right?
I think static_cast is the right way to do casting in C++, but it's true that it bloats the code
MᏫᎻᎯᎷᎷᎬᎠ
https://twitter.com/AffectiveCpp/status/1247121481064210432?s=09
MᏫᎻᎯᎷᎷᎬᎠ
It's so bad
Francisco
It kind of is, but it's safer than C-style counterpart
MᏫᎻᎯᎷᎷᎬᎠ
Imagine using this principal in your whole project
Francisco
https://twitter.com/AffectiveCpp/status/1247121481064210432?s=09
I think this example is quite bad, as I'll never use auto to declare an int