klimi
Oh yes
klimi
Dimka complex
Anonymous
Ip address of my and my neighbour's router are same ! Is it possible??
Pavel
Ip address of my and my neighbour's router are same ! Is it possible??
1. It's not a C++ question 2. There are multiple IPs, so specify which one 3. Read about NAT
Anonymous
Yes
Mat
😂
Anonymous
Anonymous
Let me guess 192.168.0.1
How is that possible 😂
Asdew
Oh darn, mine is so close. Mine is 192.168.1.1.
Asdew
We could be IP buddies.
Asdew
We've both under 192.168.0.0/16.
Anonymous
How is that possible 😂
You need to learn basics of networking
Anonymous
Can we discuss this in ot?
Mat
How is that possible 😂
It's not your public IP but the local one in your private network 🤦‍♂
Mat
#ot
Anonymous
You need to learn basics of networking
I have 0 knowledge of networking ik😂
Anonymous
Working with sockets is lots of fun
Anonymous
and lots of pain when you multithread stuff
Dima
lol
Anonymous
xD
Dima
but better with fibers
Dima
Lol
Anonymous
is anyone familiar w/ n-ary search?
Igor🇺🇦
Asdew
Working with sockets is lots of fun
I agree with you very late.
Anonymous
can you please recommend some articles, im not finding anything on the internet n-ary tree is all over the internet.
Igor🇺🇦
can you please recommend some articles, im not finding anything on the internet n-ary tree is all over the internet.
That's the same problem. Like binary search and binary tree. Represent your data a n ary tree and do search.
Anonymous
so to do n-ary search we have to implement n-ary tree?
Anonymous
can't we do it normally on an array
Igor🇺🇦
can't we do it normally on an array
Just as you don't really need to build binary tree to perform binary tree, you don't need to build tree for n ary tree. It's just gets more complicated with calculations of indexes
Anonymous
okay okay
Anonymous
What is the error?
Anonymous
And way ?
I_Interface
András
What is the error?
Visual studio is error name
Lucky
I think its just a warning
Azzam
hey everyone
Dima
And way ?
ugandian way
Azzam
bool compareByLength(pair<string, int> v1, pair<string, int> v2){ return v1.second < v2.second; } sort(dict.begin(), dict.end(), compareByLength); map<string, int> dict; this code is throwing errors.. can you please help out as I'm not getting where the error is
Azzam
What error?
Some weird error
Azzam
Wait I'll show
Azzam
In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from test.cpp:1: /usr/include/c++/7/bits/stl_algo.h: In instantiation of ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(std::pair<std::__cxx11::basic_string<char>, int>, std::pair<std::__cxx11::basic_string<char>, int>)>]’: /usr/include/c++/7/bits/stl_algo.h:4868:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >; _Compare = bool (*)(std::pair<std::__cxx11::basic_string<char>, int>, std::pair<std::__cxx11::basic_string<char>, int>)]’ test.cpp:66:55: required from here /usr/include/c++/7/bits/stl_algo.h:1969:22: error: no match for ‘operator-’ (operand types are ‘std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >’ and ‘std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >’) std::__lg(__last - __first) * 2, ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from test.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:392:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&) operator-(const reverse_iterator<_IteratorL>& __x,
Joan
https://github.com/jalbam/c_games
Azzam
Why are you sorting map?
I want to create a dictionary..
Anonymous
use scanf_s
Yes it works but why? My teacher said she want to scanf not scan_s
András
I want to create a dictionary..
Map is already sorted
Chernykh
In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from test.cpp:1: /usr/include/c++/7/bits/stl_algo.h: In instantiation of ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(std::pair<std::__cxx11::basic_string<char>, int>, std::pair<std::__cxx11::basic_string<char>, int>)>]’: /usr/include/c++/7/bits/stl_algo.h:4868:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >; _Compare = bool (*)(std::pair<std::__cxx11::basic_string<char>, int>, std::pair<std::__cxx11::basic_string<char>, int>)]’ test.cpp:66:55: required from here /usr/include/c++/7/bits/stl_algo.h:1969:22: error: no match for ‘operator-’ (operand types are ‘std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >’ and ‘std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >’) std::__lg(__last - __first) * 2, ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from test.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:392:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&) operator-(const reverse_iterator<_IteratorL>& __x,
Very readable) Try to make ur comparator as std:: function, lambda or struct with overloaded ()
Azzam
Map is already sorted
Yeah Ik but actually in dictionary words are first sorted according to length.. Ex - Hi Hello
András
Yes it works but why? My teacher said she want to scanf not scan_s
Search in Google, how to disable secure errors in visual studio, or just remove VS from your PC
Azzam
Very readable) Try to make ur comparator as std:: function, lambda or struct with overloaded ()
Can you please explain a bit more it will be helpful.. Also thanks
András
You can't sort map
Anonymous
Visual studio is error name
Why ? You mean “LINKER”
Azzam
You can't sort map
It says "we can"
András
Did that
First link in google gives correct answer
Chernykh
Referred to cppreference: u should pass ur comparator as a class with overloaded call operator, there are some ways to make it: std::function - special class which made all dirty jobs instead of u, just see in docs how to use it struct with overloaded () - see example on cppreference lambda - should I really explain how to use it?
Chernykh
Nahh, you don't need to explain . Thank you very much for pointing me in the correct direction... Thanks once again . I'll read from there
One moment really need to understand. If u watched how it works under hood there are many debug and check macros checking types u passing and so on
Chernykh
Just click Ctrl+*click on sort function*
Azzam
Owh.. Thanks
Chernykh
There is meaning of copy "sort" function - easiest way to implement what u want without std library checks
Chernykh
std::sort - cppreference.com https://en.cppreference.com/w/cpp/algorithm/sort
Chernykh
Check it out
Anonymous
https://github.com/jalbam/c_games
And why do we need this here?
Joan
And why do we need this here?
Is this not a C group?
Joan
Maybe it is useful for someone who wants to learn
Anonymous
Maybe it is useful for someone who wants to learn
Your code is not good to learn something from
Chernykh
Maybe it is useful for someone who wants to learn
So why not to send opengl also written on C. It also use to write games