olli
Anonymous
/get c++
Anonymous
/get anynotes
Mp
anyone knows data structure?
Artöm
Mp
can i message u in pv?
Artöm
Please no
Mp
ok it says sort from worst to best
Mp
sort the table after 0(f(n) efficiency
Artöm
Do you know how to compare classes of functions like log and linear?
Artöm
Or do you know how to calculate a limit?
Mp
no
Mp
what is the step?
Artöm
The you should just memorize it
Artöm
Const is the best, then log, then linear, then powers > 1, then exponent, then factorial
Artöm
If you have like n^2 vs nlogn, its same as n vs logn
Artöm
This is math btw, not programming per se
Mp
thanki very much
Mp
one more question
Mp
Mp
it says write 0()efficiency for each algorithm
Mp
what should i do?
Mp
What do u mean?
Mp
like i dont understand
Mp
how to calculate it
Alex
https://www.amazon.com/Algorithms-Parts-1-4-Fundamentals-Structure/dp/0201350882
Alex
in this book you can find examples how to calculate
Alex
or google how to calculate
Mp
i should google to calculate what????
Alex
O for complexity algorithm
Alex
it says write 0()efficiency for each algorithm
Mp
i couldnt find anything on google
Mp
could u please provide somelink for that?
Alex
Веселый Роджер
heya, can i have some advice pls.
I need to use the write() functions to out put a char array of 3 elements. How to i do that?
Alex
write(fd, arr, sizeof(char) * 3)
Pavel
Will copy elision (NRVO) be performed in C++17+ if the function have multiple returns that return the same variable.
like this
MyClass foo() {
MyClass result;
if (precondition.fail()) { return result; }
...
return result;
}
olli
Pavel
Nils
for (const auto& channeldesc : channels + 1)
Is that the correct way to start iteration at second element?
Alex
show declaration of channels please
Artöm
Nils
Anonymous
Anonymous
use a normal loop
Nils
Anonymous
oh
Alex
Anonymous
how?
数学の恋人
数学の恋人
you do vector.begin()+1
Anonymous
oh lol
数学の恋人
that would be overkill tbh
数学の恋人
why not just go for iterators instead of that
数学の恋人
yeah I got you
Nils
how would the following code which is written in python look like in C++:
channel_id, channel_name = channeldesc.split(' ')
?
Nils
Is that even possible?
Nils
thx
Alex
Nils
数学の恋人
if so, maybe std::basic_stringstream can help
Alex
数学の恋人
数学の恋人
to split strings there is boost::split
Just an alternative
std::string combined{"AB123 Chanol"};
std::stringstream line(combined);
std::string channel_id;
std::string channel_name;
while(line.good()) {
line >> channel_id;
line >> channel_name;
}
Nils
I solved it already
Nils
but thx for your affort
数学の恋人
数学の恋人
I assumed it to be a string
Nils
Nils
Why does std::string::erase(0) clear the entire string?
Nils
I just want to remove the first character
Sameer
Hello Guys
Sameer
What is inline function and when and where is used.