Ashish Bhushan
@infinitEplus
Harsh
I know, but perhaps that's the meaning of question, They maybe testing if u know how strings are character arrays with '\0'
Ashish Bhushan
Bruh
Ashish Bhushan
That's an expression
Ashish Bhushan
Okk sorry
Anonymous
getchar or gets in read ?
Anonymous
oookeyyyy, let me try to understand this now. . ., I) assigning a signed int to an unsigned int results in (maxvalue - 1) condition, always? right?? or ...not? so im looking at my machine its gives me the value of -2, –which is a signed int assigned to an unsigned int, equals to (sorry for these numbers, i just want to make sure im getting this correctly), 4294967294, this is the (maxvalue - 1) thing ? noted now, II) comparison of -2, (signed being assigned to unsigned int) which is: (maxvalue - 1). so this comparison depends on the sizes of a) unsigned int or b) long ? im following so far right ? OKEEEYYY :D got you! after reading those two conditions, oneee tiny thing is bothering me now. . . if(x > -1L) . . . in my machine, x == 4294967294 and -1L == 4294967295 (x is small isn't it?) how is this getting evaluated? will every signed int getting assigned to unsigned int have same values, maxvalue-1 or how do they behave ? I really really really really appreciated your response. im re-reading it to make it concrete. Thanks alot
Рома
https://pastebin.com/raw/sp7Dhu9U I have the same trouble. Plz help me guys. Why I get misses rows.
Anonymous
Dima
I said this a long time ago lol
Dima
bruh
Anonymous
grasped! thank you, madhu, thanks alot
Anonymous
noted
mjuned
error: 'int std::uncaught_exceptions()' should have been declared inside 'std' Help
mjuned
Y
hello
mjuned
Gcc 7.5
mjuned
Sorry bro im noob will you explain in some more detail?
Asdew
Is this C/C++ or Gentoo GNU/Linux support?
Lieutenant
maybe you need to throw the exception() after throw() ?
mjuned
maybe you need to throw the exception() after throw() ?
I dont know Can you tell me what changes i have to do in file? I will compile again and show you result
mjuned
Sorry there is no folder like portage in /etc
Lieutenant
right. I don't know much about exception handling 😅. sorry
mjuned
But there is no folder that you said in /etc
mjuned
right. I don't know much about exception handling 😅. sorry
I even dont know anything I solved some error from google until now
mjuned
But i could not find solution for this
Lieutenant
But i could not find solution for this
PM Madhu, she seems knowledgeable
mjuned
Yes thats why i asked them
Marián
already figured it out thanks :D
Ajay
nice. so a class can be triviallycopyable without being trivial.
Pavel
Can anyone explain the dynamic library part?
I can find anything about dynamic library on the screenshot
Pavel
I mean here i cannot see anything about the default ctr. Can the default ctr be user-provided in a trivially copyable class?
It can, "trivially copyable" is only about copy/move constructors Not to be confused with "trivial class"
Anonymous
I am looking for a book that explains to me. What is the best way to make a program? For instance, how to decide if you need a thread in the GUI and another thread for the program. And in the same book or another, that talks about the architecture of the programs. Any recommendation?
Otumian
ds malik, maybe
Anonymous
Anonymous
Thanks, the problem is that i am doing programs but i feel a leak of design 😌
Anonymous
i will try to find one of these authors
Anonymous
I am take the note :-)
Mar!o
Hey, what do you think would perform better? A large switch with like 400 cases OR one small switch with 4 cases for each category and then bigger switches with 100 cases inside it?!
Mar!o
I mean the compiler could generate jump tables for both but for nested switches it has to only check the 100 of the category not 400 - what do you think?
Mar!o
I think the worst case scenario could be faster with the second type because: Lets say it is the 350.st enum value. So it checks 350 cases and at the 350 is breaks. With the second type it would only check the main case and then max. 100 cases and break. So it needs to compare less
Mar!o
Of course if the compiler generates the jump table it might make not such a big difference...
Mar!o
I'm just not sure I want it as fast as possible...
Mar!o
Thats true
Mar!o
I'm using C btw but i dont think it makes any difference in that case
Mar!o
Yeah you are right I should care about that... thanks anyways :)
Harsh
Use loops and iterate one by one
Ajay
Ajay
Didn't get the difference.
Pavel
my bad. this one i'm talking about
They say basically that if you're trying to write a dynamic library on C++ but want it to be compatible with C then you better to operate with POD types in your library interface (as they will have predictable to C layout in memory).
Pavel
and this one?
not sure actually, I always thought they have the same lifetime
Pavel
at least from the programmer's perspective
Ajay
I mean is there any difference in the sentence where it says that lifetime begins when storage for the object is occupied. Shouldn't that be same as when the constructor is finished?
Ajay
yeah storage is released after the destructor runs but one always happens after the other.
Ajay
i think both the sentences in the screenshot say the same thing. it's just that there is no user-defined destructor in PODs that let them say that lifetime ends when the storage is released because the trivial destructor does nothing.
Ajay
but it's weird that even if the empty destructor won't do anything, they still put it under the non-trivial thing.
Ajay
sorry for you to write that long but i knew this.
Ajay
yeah i do.
Ajay
defaulted on first declaration
Ajay
you've made it default so it's just declared but not user-provided.
Ajay
ok, another question struct Exp { explicit Exp(const char*) {} }; Exp e1("abc"); Why is the above copy-initialisation and not direct-init? I'm having a hard time recognising the difference b/w the 2. copy-init is when we create an object from another object. But here, where is the first object from which we are creating e1?
Ajay
did you make destructor inside struct.
Ajay
oh. i overlooked you code.
Ajay
what's the meaning when you say that destructor will be generated only when its is used(and compiler error is not generated). can you elaborate on this. IDK about that thing.
Ajay
class B { public: // Error, func is not a special member function. int func() = default; // Error, constructor B(int, int) is not // a special member function. B(int, int) = default; // Error, constructor B(int=0) // has a default argument. B(int = 0) = default; }; // driver program int main() { return 0; } Why is the 3rd B(int = 0) when it's the default ctr and special member function can be made default .
Ajay
AFAIK, when an object is destroyed then automatically the destructor is called and that's where it(the destructor) comes into picture. So, why isn't that needed when its sure to be called as soon as an object is going to be destroyed
Ajay
but then that's a wrong programming practice. ain't it.
Ajay
what if the i don't create it using new, will the =default give error too?
Ajay
😅not for me.
Ajay
but won't the one with user-defined destructor work as well?
Ajay
for the =default case?