Gnostic Trades |
depends on your purpose
I want to do competetive programming
Alex
I want to do competetive programming
probably you should make research and find out what languages are used
V01D
who is s(he)?
Got the name wrong, I meant to ping you.
再见莫妮卡
woo
Vlad
nice virus btw. 28 bytes
Dima
nice virus btw. 28 bytes
no, it’s a file (lol!) with youtube link (loooool)
Etamys
it's not virus
Vlad
Would have been cooi if it was an actual virus in 28 bytes lmao.
su
Would have been cooi if it was an actual virus in 28 bytes lmao.
it will be very specific, as all tiny viruses, for one maximum two systems on a world, and C nor C++ can provide such level of compactness, usually <1K bytes COM or TSR viruses used some self packers similar to DEMOSCENE 64K/4K/1K, at least required a MASM, TASM, or NASM and Amiga or 68086 ALU and CPU tricks knowledge, to use some CPU, system BIOS and video BIOS extensively to make some screen effects (for such small viruses , there no way to use socket or even floppies)
su
cause nobody knows how to utilize new CPUs instructions (except me of cause) other way than waiting new version of gcc, intel vtune or embracarero, demoscene is almost dead, btw
RV
Anybody pls , suggest me which is the better platform to practice competitive programming??
RV
How about codeshef , leetcode and all?
Vlad
https://godbolt.org/z/j3371T
Vlad
I'm pretty sure that string is a wrong container for the task.
Vlad
Also reserve DOES NOT create objects
Vlad
So you have to resize to be UB free
Etamys
How about codeshef , leetcode and all?
yep you can go for it....but Hackeearth is good for beginners for practice
Anonymous
Hi am new in this group
Pavel
How rude
Accel
you can’t complete C
yep you can't complete any lang
Asad
How can I convert std::wstring to std::string?
Vlad
Vlad
If you guarantee that symbols are within char range than plain old copy
Asad
I have this code to get the current working directory. I need to combine the CRW with some file name... But, the compiler is throwing me errors saying that I cannot do it using std::wstring. Is there any way to get it work?
Asad
You are saying that I cannot convert std::wstring to std::string. In that case, How can I go about doing the task?
Alex
How can I convert std::wstring to std::string?
I think you can use something like sizeof(wchar_t)/sizeof(char) to get number of string elements for each element of wstring
Vlad
I think you can use something like sizeof(wchar_t)/sizeof(char) to get number of string elements for each element of wstring
I'm pretty sure that won't work because code expects a null terminated strings and you may have a null byte in the wchar_t
Alex
you can use \0 in string as data
Alex
you can store binary data(including \0) in string
Vlad
its not a big problem to handle
Agree you just cannot .c_str() anymore. Although not sure why would you convert.
Vlad
Need raw data? Then you may just .data() wstring
Alex
Agree you just cannot .c_str() anymore. Although not sure why would you convert.
it depends what you are expecting in char *, its possible to use it in function(char *data, size_t len) which expects binary data
Vlad
Could be anything really. But it basically says that you are out of bounds in a stack array
Alex
Need raw data? Then you may just .data() wstring
probably vector<uint8_t> is the best for binary data, but there are API which reads file, network etc and can return string
Alex
don`t know why do I need wstring for it
Vlad
Cause your code goes out of bounds dummy
Anonymous
Help
Fei
Hi
Asad
google what is TCHAR and how to convert TCHAR buffer to string
I am so annoyed that I can't even do this.
Artöm
Throw this tchar shit away if your app is small and win only, use wstring everywhere
Artöm
Or string everywhere
Asad
I have found another way to get the current directory. Thanks anyways!
Anonymous
> deprecated
it will remain in the standard until a suitable replacement is standardised
Anonymous
oh
Anonymous
"Unfortunately, that was wishful thinking. Deprecation was applied to C++17. The recommendation apparently is: "Users should use dedicated text-processing libraries instead." Visual Studio 2017 will issue deprecation warnings when used." i didn't see this comment. oof https://stackoverflow.com/a/43153057
Artöm
libicu ftw
Anonymous
Can someone please recommend good books for learning data structures through c++ or c. C++ is more preferred.
kodes
if(s.find(val)!=s.end()) { s.erase(val); } Can someone explain the if statement why we used s.end() here?? PS: s is a set
Alex
because if val is absent find returns s.end()
Anonymous
because if val is absent find returns s.end()
What if the value we want to find is last value?
Anonymous
Alex
s.end() is not the last. this is like empty iterator
Anonymous
Aah oke
Alex
like nullptr
Anonymous
end() iterator points to past-the-last element
Anonymous
Anonymous
like nullptr
Neither is this
Kenny
What project should i do to learn more C++?
Kenny
I just learned this year some Data Structures
Kenny
Like BST, Linked List, etc
Dadaskis
Create 2D stuff using SFML, just my weird option
Kenny
Oh, looks nice