Anonymous
Yes, it called recursion
I want recursion idea..
Indolent
I thought the author had gone insane
Anonymous
I try to learn so much recursion..but i don't learn it
Anonymous
Help to get easy understand recursion topic
Indolent
Watch a Youtube video on it
Indolent
preferably in your native language
Pavel
Help to get easy understand recursion topic
to better understand it you need to understand how functions being called (specifically about callstack)
Pavel
then I think it will be more clear, because technically the logic with recursive calls is the same as with any other function calls
Anunay
That's it
PO
hi
PO
someone has ever used optstring function in getopt() library?
Ajay
how does it decide upto which comment need to be purged?
PO
I should take argument from command line with that
Ajay
Can anyone explain this a bit for me : sizeof takes into consideration of padding and alignment. It's standard compliant to have a sizeof(unsigned long) of 8 bytes but the overflow behaves like 4 bytes. It's way wrong trying to use sizeof and CHAR_BITS to calculate the limit of an integer type. Use limits.h when it should be used.
Ajay
yeah, I know that but didn't get what it says about the sizeof and the overflow thing.
PO
Thank you, ./ My program -f <fomat> <file_name> My program should take all files with .ppm .pbm and .pgm format and when user insert wrong format file, the program should show a Error message (I do that in C)
Ajay
actually read this in a SO comment. https://stackoverflow.com/questions/35844586/can-i-assume-the-size-of-long-int-is-always-4-bytes
PO
I have to use optstring, my teacher say that if not I'll lose point
Artöm
That being said, limits.h is better than manual calculation
Artöm
I read. I meant that 8 bytes ulong overflows like 8 bytes ulong
Artöm
@lightness_races_in_orbit do you know any platform that has padding in integral types (no bool)?
Artöm
I dont get it
Artöm
They overflow in same modulo 2 way, that I know
Artöm
But it is not just compilant, it is required
Anonymous
Can anyone explain this a bit for me : sizeof takes into consideration of padding and alignment. It's standard compliant to have a sizeof(unsigned long) of 8 bytes but the overflow behaves like 4 bytes. It's way wrong trying to use sizeof and CHAR_BITS to calculate the limit of an integer type. Use limits.h when it should be used.
> It's way wrong trying to use sizeof and CHAR_BITS to calculate the limit of an integer type. Use limits.h when it should be used. This will be fixed in the next standard version where 2's complement code will be forced. But i don't think there is any environment out there (other than embedded) where integers don't use 2's complement. you can use sizeof and CHAR_BITS to calculate the limit of an integer just fine
Artöm
Most likely my english just sucks. I dont get why in that quote one used 8 and 4, like, what about 2 and 1? Whats the point of that sentence?
Anonymous
ye
Artöm
I'd say they exist and work well, but wont use new standards anyway since no new code is being written for them, only support stuff
Artöm
I saw jf bastiens talk about 2compl and there were some non 2compl archs back in 80s. 40 years is not that long to be sure tgey are not used anymore
Artöm
Point is, they are not targeted, they just wait to die out
Artöm
I agree with that, I misread the quote
Artöm
What I mean is, the comitee talked about adopting 2compl for a while, and since no one was naming non 2compl archs widely used today to contra, its safe to adopt
Artöm
That reply is about different matter. Regarding unsigned, I misread the quote, sorry. And I never said you replies were bullshit
Artöm
Ye
Anonymous
actually the comment is talking about a theoretical scenario because the standard doesn't force 2's complement code > It's standard compliant to have a sizeof(unsigned long) of 8 bytes but the overflow behaves like 4 bytes. i can have an unsigned long whose size is 8 bytes but with MIN 0 and MAX 4294967295. i can use the remaining 32 bits for error checking, sending secret messages to FBI. this is allowed because of the lack of forcing 2's complement.
Artöm
It has no links because to my understanding standard doesnt mandate that e.g. 32 bit unsigned integer uses all 32 bits and has no unused bits as padding
Anonymous
ye. but that is what the comment was talking about
Anonymous
the commenter(commentator?) is talking about a theoretical implementation
Anonymous
It's standard compliant to have a sizeof(unsigned long) of 8 bytes but the overflow behaves like 4 bytes. It's way wrong trying to use sizeof and CHAR_BITS to calculate the limit of an integer type. Use limits.h when it should be used. i.e. i can make weird sized unsigned integers if i want in my theoretical implementation. it would still be standard compliant. don't depend on sizeof * CHAR_BITS
Anonymous
> No. The comment was talking about sizeof not being CHAR_BITS * sizeof(integral type). yes. and as one example of sizeof not being CHAR_BITS * sizeof(integral type) the commentator said - "It's standard compliant to have a sizeof(unsigned long) of 8 bytes but the overflow behaves like 4 bytes. It's way wrong trying to use sizeof and CHAR_BITS to calculate the limit of an integer type. Use limits.h when it should be used."
Anonymous
he used two examples. one was about alignment and padding. other was about weird sizes
Anonymous
we are not even interpreting the standard. i'm talking about the comment
Anonymous
in stackoverflow. that the person asked about
Anonymous
this comment. it's not a quote from the standard
Anonymous
oh right
Ajay
It's standard compliant to have a sizeof(unsigned long) of 8 bytes but the overflow behaves like 4 bytes. I get that overflow of unsigned are not UB but what does but the overflow behaves like 4 bytes mean? What's the significance of those 4 bytes?
PO
Can I ask you an other question?!
PO
How can I get string from command ligne with using optstring
PO
?!
Ajay
Oh god !! Wasn't that quite straightforward. He should have written that it simply behaves like a general unsigned overflow.
LostInNeonCity
Please a want this book : Norme ANSI for free , help plz
Dima
no piracy here
LostInNeonCity
Okey thanks
MᏫᎻᎯᎷᎷᎬᎠ
no piracy here
Hi sir can send me pdf c++ book from amazon free
MᏫᎻᎯᎷᎷᎬᎠ
hahhaaha
Dima
Hi sir can send me pdf c++ book from amazon free
I thought you would ask for python book
MᏫᎻᎯᎷᎷᎬᎠ
rinaigen
Hello to all.
rinaigen
I am a beginner in programming. I need to your advice.
rinaigen
I have red that to be better, need to learn languages like pairs.
rinaigen
C++ & Python or Java & Python. What is the best way?
rinaigen
I have been reading a lot of information about it, but i did not look for any useful. I know, that better to ask people who is a programmer.
rinaigen
Cuz, a lot of library are written by CPP and combination Java + Python = JPython.
rinaigen
I am planing to work with bots and anythings like it.
rinaigen
AI for example.
Anunay
Then choose GoLang and Python
Anunay
They have ML/AI libraries
Anunay
Most guys don't write ML libraries of their own, it's a lot of work and research