Ralph
Yeah i've removed the = 0 and it's the same time 👌🏿 thanks
Ralph
Is there anything else i can do for it?
Ralph
I am trying to get the maximum sub array sum in 2 tries. The first is divide and conquer, and the second (which i sent) is a brute calculation for it
Igor🇺🇦
Ralph
So it should be like that?
Ralph
Or is there a way to make it in O(N)
Ralph
I will check it
Ralph
Thank youu
Anonymous
While I'm running the code in visuval stidio code I'm getting an error ' vscanf enterrupted'
Anonymous
Can any one allow me to send the problem by video ?
Manish
HI , Is there any alternatives for <sys/time.h> in windows?
Manish
or something else which works on cross platform?
Anonymous
Georges
Hello. How can i implement a function that returns the maximum possible profit but using divide and conquer.
I have to use templates so the parameters should be Iter start and Iter end only
Vlad
Anonymous
/warn @TU_NaoL PMing
Thailand import
Hello, how to create a calculator that can use any arithmetic operator in the same time? For example, calculate 2+6-1*8/9
Thailand import
Because, what I find in Google is only show all those simple calculator. I knew that
Anonymous
Thailand import
Thailand import
Not C++, forget to tell sorry
Anonymous
Using C
write yourself x)
Thailand import
I dkk that why Im asking 😂😂
Ehsan
Ehsan
https://stackoverflow.com/questions/31104531/calculator-in-c-using-stack
Thailand import
Oh tq Bro🙏
Anonymous
Using C
Data structures and Algorithms
Stack - Operator precedence, Infix, postfix
Learn it.
Anonymous
You can use that to create a calculator in C
Thailand import
Okk
Thailand import
Tqtq
Abhishek
👍
L@L@JI
Yes
Amulya Mohan
Ye thank you
M
Hi , how can be resolve a domain with defined dns server in c code ?
Thailand import
Thailand import
Thailand import
Simple calculator only I can make it🤕
Manish
Hi, Is there anything equivalent to release() for a raw pointer?
Pavel
Vlad
Ralph
Does anyone know why how to fix the error "Non-Void function does not return a value in all control path"
Артём
Ralph
It contains
Ralph
That's what is disturbing
Vlad
Ralph
I still have the error
Ralph
If i add a return after my if { return expression;} it works
Ralph
But i have 3 if's with each a return and i have the error at the closing bracket of the function
Ralph
I will send 2sec
Vlad
Ralph
int peak(std::vector<int>& v, int start, int end) {
int middle = (start + end) / 2;
if ((v[middle] >= v[middle - 1]) && (v[middle] >= v[middle + 1])) {
return middle;
}
if (v[middle] < v[middle - 1]) {
return peak(v, start, middle - 1);
}
if (v[middle] < v[middle + 1]) {
return peak(v, middle + 1, end);
}
}
Ralph
And how should i call it
Ralph
I mean i want the return if the expression is true
Vlad
Or else it might fall through
Артём
Ralph
What do you mean
Igor🇺🇦
What do you mean
If all " if" are false you'll not return anything.
Vlad
What do you mean
Compiler cannot analyze that those conditions would be always met
Ralph
Oh
Vlad
It simply assumes that they wont
Ralph
Yeah i see. That's why when i return a value outside of the if's it works?
Vlad
Vlad
Didn't get anything
Ralph
I've added a return 1; after all the if functions. The build succeeded, and it returned 1
Vlad
Vlad
You could return smth like -1
Ralph
Yeah and it worked
Vlad
To indicate out of bounds or smth
Ralph
Yeah i see