Skip to main content
Code Review

Return to Question

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

I think I've found an implementation that uses templates but I'm not really sure it's solving the IOC problem.

I think I've found an implementation that uses templates but I'm not really sure it's solving the IOC problem.

added 3 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Random class in C++

I've very new to C++, I've and have been working through a tutorial and got as far as std::rand(). I was immediately horrified and rushed out to see if I could implement this as a service. This is my (pretty basic) non-cryptographically-secure implementation in the style of .Net's System.RandomSystem.Random.

Random class C++

I've very new to C++, I've been working through a tutorial and got as far as std::rand(). I was immediately horrified and rushed out to see if I could implement this as a service. This is my (pretty basic) non-cryptographically-secure implementation in the style of .Net's System.Random.

Random class in C++

I've very new to C++ and have been working through a tutorial and got as far as std::rand(). I was immediately horrified and rushed out to see if I could implement this as a service. This is my (pretty basic) non-cryptographically-secure implementation in the style of .Net's System.Random.

added 29 characters in body
Source Link
Nathan
  • 647
  • 3
  • 7
  • 18

I've very new to C++, I've been working through a tutorial and got as far as std::rand(). I was immediately horrified and rushed out to see if I could implement this as a service. This is my (pretty basic) non-cryptographically-secure implementation in the style of .Net's System.Random.

unique_ptr<IRandom> randomService = make_unique<Random>();
cout << "NUMBERS" << endl;
for (int i = 0; i < 10; i++)
{
 cout << randomService->Next(0,10) << endl;
}
auto buffer = vector<uint8_t>(100);
randomService->NextBytes(buffer);
cout << "BUFFER" << endl;
for (auto &i : buffer)
{
 cout << i << endl;
}
return 0;

I've very new to C++, I've been working through a tutorial and got as far as std::rand(). I was immediately horrified and rushed out to see if I could implement this as a service. This is my (pretty basic) implementation in the style of .Net's System.Random.

unique_ptr<IRandom> randomService = make_unique<Random>();
cout << "NUMBERS" << endl;
for (int i = 0; i < 10; i++)
{
 cout << randomService->Next(0,10) << endl;
}
auto buffer = vector<uint8_t>(100);
randomService->NextBytes(buffer);
cout << "BUFFER" << endl;
for (auto &i : buffer)
{
 cout << i << endl;
}
return 0;

I've very new to C++, I've been working through a tutorial and got as far as std::rand(). I was immediately horrified and rushed out to see if I could implement this as a service. This is my (pretty basic) non-cryptographically-secure implementation in the style of .Net's System.Random.

unique_ptr<IRandom> randomService = make_unique<Random>();
cout << "NUMBERS" << endl;
for (int i = 0; i < 10; i++)
{
 cout << randomService->Next(0,10) << endl;
}
auto buffer = vector<uint8_t>(100);
randomService->NextBytes(buffer);
cout << "BUFFER" << endl;
for (auto &i : buffer)
{
 cout << i << endl;
}
added 77 characters in body
Source Link
Nathan
  • 647
  • 3
  • 7
  • 18
Loading
added 90 characters in body
Source Link
Nathan
  • 647
  • 3
  • 7
  • 18
Loading
Source Link
Nathan
  • 647
  • 3
  • 7
  • 18
Loading
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /