Prince Of Persia
A char is a byte So have 8 bits
Each bit can only contain 1 or 0
Anonymous
has a value 8
Anonymous
binary is 1000
Anonymous
I know this
Anonymous
How does it shift
Prince Of Persia
How does it shift
Ok 1 = 00000001
Anonymous
b: 5 dec => 0101 binary c: 0101 << 1 => 1010 binary => 10 dec d: 0101 >> 1 => 0010 binary => 2 decimal
Anonymous
its an example
Prince Of Persia
When we shift this value (00000001) to left For example shift 2 times It will be 1<<2 00000100
Anonymous
Alright, thanks to both of you
Prince Of Persia
Anonymous
you move the most significant bit or the least significant bit
Anonymous
thats is
Prince Of Persia
Alright, thanks to both of you
Btw you should use unsigned types for shifting
Anonymous
I really appreciate your help guys
hiddenpiggy
for 32-bit signed integers, it is also OK to do shifting operation.
Ammar
hiddenpiggy
but you need to note : 1. there are two kinds of right shifting operation(arithmetical one and logical one) 2. if the integer is negative, we often use two's complement to express it.
𝙑𝙞𝙨𝙝𝙖𝙡
Left shift formula is x = n*2^k Right shift formula is x = n/2^k
hiddenpiggy
Maybe faster than multiplication operations
Anonymous
Nice to meet you
V
Hi can anyone help me with program using pointers ? Please DM me .
Amu
does anyone here know basic algorithms? can you help me with a theoretical question?
Abdurrasheed
Amu
just ask the question already
(a) Show that n(n−1) pn,m≤ 2m . Hint: union bound (and you really only need pairwise independence). Note: This says that if n ≤ √m, then the probability that there is a collision among the Xi’s (i.e., two Xi’s taking the same value) is at most 1/2.
Amu
not c related but im sure u cs people here have some idea
Amu
by theoretical i meant not a programming question
Amu
So not your theoretical question but your homework
and yes its my homework but i dont think theres any problem with seeking out support when im stuck and sharing ideas with people here, so please don’t give me attitude for it
Anonymous
/get ide
Anonymous
/get
Anonymous
Shut up! Crazy bot
Dima
Bruh
Anonymous
Bruh thats how this people are hear..braffing over nothing...u ask a question the start given altitude
Amu
Bruh thats how this people are hear..braffing over nothing...u ask a question the start given altitude
Bro that’s what pisses me off! I asked a simple question as respectfully as possible and they go ahead and bash me
Amu
Maybe you can ask in a algoritm and data structure group
Thanks that’s a good idea, I’ll search for it
Nomid Íkorni-Sciurus
Hello! Is it possible for GCC to produce a intermediate file such that another GCC suite could cross-compile it for another architecture?
hiddenpiggy
so it will be automatically initialized with 0?
J
Bro that’s what pisses me off! I asked a simple question as respectfully as possible and they go ahead and bash me
Nobody bashed you guys here. You're only bashed when you ask a question and don't give an example of the code you've found a bug or error on. If you provided your question with your "try-code", then no one can bashed you. You're only bashed when you want to act lazy, self taught programmers hate that attitude. If it took you 10 hours everyday to learn something and you fully gained expertise on it, then another person comes to learn and start asking questions when not even showing interest, I guess you'll bash them also. So to avoid bashing, ask questions with your code. For questions that don't have code, you can pretty get it quickly from google, so save the stress for the group. Have a nice day
Roxifλsz 🇱🇹
Wow, that's quite the wall of text, I would just say something super simple and rude :)
Amu
Anyways let’s stop the negativity here, congrats on being a self taught programmer Udoh
Amu
And sorry everyone else for all this negativity.
Anonymous
so it will be automatically initialized with 0?
and for any other value you can just provide a second argument to resize()
Nomid Íkorni-Sciurus
I wonder what is your use-case for that?
I have two GCC suites, but the first one doesn't support my target architecture.
Nomid Íkorni-Sciurus
Clang definitely can
yeah I've come up with that as well
Nomid Íkorni-Sciurus
I can definitely produce an intermediate IR binary to be compiled.
Hermann
how print type in c++? i dont like typeid(x),name()
Anonymous
Hermann
https://github.com/Neargye/nameof
it seems excessive to me ...
Anonymous
Anonymous
It's just one header
Hermann
aren't there any functions in c ++ that do something so simple?
Gaurav
how to find max length of bitonic subarray can anyone explain?
Lion
there's __func__
Although __func__ works only in a function, here's the trick: use function template to accept a type, so the instantiated function will have the name of the type in its fully qualified name. Then a parser will do the remaining drity works.
Lion
well, as for a simple way to do that, no.
Ahadu
What is good Dev-cpp or visual studio
Ahadu
Dev C++ is not good
I can use Dev C++
Lion
typeid(T).name()
which you don't like.
Nameful
Why
If I recall correctly it isn't supported any more
Lion
boost::type_index has the whole story, if you want to dig deeper. Both RTTI or not.
Ahadu
yes
Do you create any app