vinícius*
it'll likely have C on it, not necessarily C++
vinícius*
such as Arduinos, for example, they run a subset of C++ but don't have access to C++'s STL
vinícius*
yeah I'm talking about this
Wojak
Y u do dis? (Please paste your code here or if it's long, post a hastebin.com link.)
Anonymous
oh. what's wrong in it?
Anonymous
you didn't look at the answer. it mentions that std::random_device can be deterministic. it also mentions how to use getrandom(), /dev/urandom, CryptGenRandom and a bunch of other solutions based on platform
Anonymous
ye it has solutions for BSD too
Anonymous
"There is one final caveat: modern OpenBSD does not have /dev/urandom. You should use getentropy instead."
Anonymous
followed by an example
Anonymous
oh
Anonymous
welp, idk openbsd
Anonymous
oh. then the bsd part of the answer might need correction. but the rest is fine, right?
Anonymous
what is the alternative for BSD though?
Anonymous
oof
Anonymous
oh @bsd > Reading random bits from random hardware devices. that didn't seem like the point of the question. it was basically "std::mt19937 mt(rd()); looks bad. how can i make it better and portable" and the answer provided a bunch of solutions mentioning that you need to depend on platform specific solutions.
Anonymous
i provided him the SO link because i was about to post std::mt19937 mt(rd()); in the next message
Anonymous
@first paragraph - no. my answer was suggesting random_device to seed mt19937 as an alternative of srand with time, and then mt19937 as an alternative of rand.
Anonymous
rand() is implementation defined though, and the C standard makes no guarantees about the quality of sequence produced.
Anonymous
Call getrandom()
Anonymous
Cry until it returns
Anonymous
MT is a standard algorithm but rand() can be anything, can't it?
Anonymous
oh
NB᭄Navin
Hi
Anonymous
oh. ye sure lol
Dima
but this is unrelated to c++
olli
thanks @venividivici1
destroyed
🤦🤦🤦
Anonymous
I am new to programming society...can you have any tips for me to become a software engineer
Anonymous
Do i need to learn c or c++ language for this? Thank you...i will be very grateful
Anonymous
hie guys im new here....i like c
Anonymous
Will c and c++ help me to be a good proggramer?
Anonymous
++
Anonymous
hie guys im new here....i like c
will you help im in my first year🙆‍♀️
vinícius*
I am new to programming society...can you have any tips for me to become a software engineer
software engineering is mostly about performance and scalability
vinícius*
learn data structures, classical algorithms
vinícius*
algorithm design & analysis, etc.
vinícius*
Will c and c++ help me to be a good proggramer?
C will make you care about memory management which is a good thing
Anonymous
Thank you everyone for your kind support... Thank you very much
Anonymous
Yes thanks you every one for sopport
Abdurahmane
/cbook
Abdurahmane
/get cbook
Anonymous
/get
Anonymous
rosee is bot or a human being
Anonymous
Anonymous
she takes the arguments
Ибраги́м
#include <vector> #include <iostream> auto PrintAny(auto&& Argument) { if constexpr (requires { Argument.begin(); }) for (auto&& x : Argument) std::cout << x << " "; else std::cout << Argument; std::cout << std::endl; } auto main()->int { PrintAny("hello"); PrintAny(2.71); PrintAny(std::vector{ 1, 2, 3, 4, 5 }); }
Ибраги́м
https://www.reddit.com/r/cpp/comments/i15g4p/c_has_become_easier_to_write_than_java/fzuq0jp?utm_source=share&utm_medium=web2x
Ибраги́м
auto main()->int what is this kotlin
C++ since C++11 or 14 I suppose
Artöm
she takes the arguments
It made me laugh
Artöm
Take dem arguments girl
Francisco
auto main()->int what is this kotlin
I'm starting to adopt that style in my code. Seems more natural to me
Anonymous
It made me laugh
it made me too when i gave her argument
Ибраги́м
const auto v = std::vector {1, 2, 3}; ?
2017 FTW. std::vector v {1, 2, 3};
Ибраги́м
C++11
Yea, 14 made trailing return types optional in many cases
Francisco
const auto v = std::vector {1, 2, 3}; ?
You can do that. The thing is being consistent with the style you choose
Francisco
I don't normally do it that way. Only in places where I don't really care about the exact type
Francisco
For example, I don't care what std::distance returns exactly, but I know it's going to be some integral type, so better use auto to ensure you get the best result
Alex
I use auto for iterators
vinícius*
same
vinícius*
I use auto when I don't want to type a long std variable name
Anonymous
In .vimrc If I want to add #include<stdio.h> to every file which i open via vi command Which command should i use? Is this possible?
Anonymous
also, if you're using linux, you can do a bash script for that: #!/bin/bash echo "#include <iostream>" >> $1.cpp && vim $1.cpp
Anonymous
Thank you
Anonymous
also, if you're using linux, you can do a bash script for that: #!/bin/bash echo "#include <iostream>" >> $1.cpp && vim $1.cpp
when you execute the script just type in the name of the file you want to create, for example: ./script hello Will create a file named "hello.cpp" and add "#include <iostream>" to it and you'll be inside of vim automatically, ready to write awesome programs
Anonymous
😁👌
Anonymous
😁👌
Worked so well... exactly what I wanted to have... thanks!! 😊
Anonymous
Hey, does anyone know any discussion groups related to Linux? 🙂