Mat
Second case i'd always use an array First case i'd use a vector if i don't care about speed but i'd like to not have size problems or have some sort of optimization about the memory usage (I don't know how much optimization however) or an array if i can estimate an upper bound and i'm able to occupy that amount of memory all the time i'll have that array
Mat
Is it wrong?
Anonymous
i=7, j=8, k=9; printf("%d", i-7 && j++ <k); printf("%d %d %d", i, j, k);
Anonymous
What will be the output?
糕糕
I'm a software engineer with 6 years of industry experience (most in Java & Python). Recently, I got a new job that requires me to learn C++. I just started doing some Leetcode practice problems. Wondering may I get some help in code review if possible? Want to make sure the C++ code I wrote is up to industry standard. I'm happy to help on Java / python in exchange. Thank you very much!
糕糕
糕糕
糕糕
Those are my code for leetcode question 427 and 538. It seems I'm too new here to post external links, sorry for the inconvience.
糕糕
Thank you Klimi!
klimi
No worries
klimi
Anything for a cute kitty
Anonymous
What do you think on SICP? Is it worth reading today?
Anonymous
Explain your motivations
j
https://gist.github.com/rexto/08351900294f1b082f2081c04419e80f
j
help me pls
j
i dont get why it does not compile
j
im passing the array as an argument
j
but i must bedoing sth wrong
j
okay, solved
Mr. Mahesh
#cpp
Mr. Mahesh
#cppbook
Anonymous
Thanks
Anonymous
Hey guys
Anonymous
Which IDE did you used
Anonymous
For those extremely large project
olli
What will be the output?
Tried running it?
Abdul
how to calculate the number of days for a year to determine leap years based on the number of days for one year ...
Abdul
to determine leap years
Anonymous
For 1st printf= 1 For 2nd one 0,9,9
That is what I thought but first print is 0
olli
counting days for one year
Count where from? What information will be given to your function?
Anonymous
How is that possible
olli
That is what I thought but first print is 0
Of course, why should it be one?
Anonymous
How
Anonymous
Can you explain please
olli
Can you explain please
7-7 && true is false. Since the left side is false the statement can not be true. Therefore the right expression will not be evaluated. Hence the statement has not side effect and the values remain unchanged. To cite The && operator groups left-to-right. The operands are both contextually converted to bool. The result is true if both operands are true and falseotherwise. Unlike &, && guarantees left-to-right evaluation: the second operand is not evaluated if the first operand is false. The result is a bool. If the second expression is evaluated, every value computation and side effect associated with the first expression is sequenced before every value computation and side effect associated with the second expression [expr.log.and]
Anonymous
7 -7 && j++ is 0, 0<k true, so 1
Anonymous
That is how I think
olli
Thank you so much
No worries :)
Ak47
That is what I thought but first print is 0
Yes, it is. Because precedence of && is lower than <.
Abdul
HI all...
Abdul
how to count days for one year .. ?? with c ++
Abdul
thankyou
Ak47
Only count days or check leap year
Abdul
What u want?
I want to know if the number is 365 or 366 in one year to check leap years :D
Abdul
sorry my english is bad :D
Ak47
Same here😆😆😆
Ak47
A year than have 366 days called leap
Ak47
How we check a year leap or not?
Ak47
We divide first it to 400 if it divided properly and don't leave any reminder it is leap
Ak47
We divide first it to 400 if it divided properly and don't leave any reminder it is leap
If it is century year example 1200,1600,2000 is leap years and properly divided by 400
Ak47
And if it is not century year like 2004 2008 1604 1616 etc. We divide by 4
Ak47
Otherwise not a leap year
Ak47
Overall a year is leap year if it is completely divisible by 100 & 400 both or not divisible by 100 but divisible by 4
Abdul
how do i write the algorithm ...?
Mihail
how do i write the algorithm ...?
With a keyboard, maybe?
Abdul
With a keyboard, maybe?
😱😁😁😁😁😁
Ak47
If(year % 100 == 0) { If(year % 400 == 0) //Year is leap } If( year % 4 == 0 ) // Year is leap Else //Not leap
Ak47
With a keyboard, maybe?
Right bro😆😆😆😆😆
Abdul
Ariana
idiv:>
Ak47
gcd:>
Plz explain how?
Abdul
I think no
if i use sum of days,,,, how to looking for sum of days,,?? whether this is possible or not
Ak47
365 % 7 always produce reminder 1
366 % 7 always produce reminder 2