Basic C++ Pseudo-Random Number Generation [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am learning C++ and something I would like to do is be able to generate pseudo-random numbers. I am aware that you can #include <random> however it seems as if that is still unstable (I could not get it to work.) Any help on the matter is appreciated. Thanks.

According to this question, #include <random> is a C++11 header. You might want to check if your compiler supports it, and that the proper flags are set.
Otherwise, have you looked at rand()? It should be enough for basic random numbers.

Related

Calculating large numbers in C++ without external libraries [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I need to write a program that will perform operations on float numbers higher than 10^100.
I can't use any arbitrary precision mathematics libraries that are not included in GCC package by default.
I have NO idea how how to go about it.
Can you point me in the right direction?
You can create a class that can store larger numbers. 12345678 equals to 1234 * 10e4 + 5678.
For large numbers I use string buffers and do manual computation on it. It is much overhead and slow but you get infinite precision.

Bindind to keys C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
Hello there I am a realative newbie when it comes to using different "commands" in order to achieve things so I was wondering if any of you know a way to bind a key to do a certain task anywhere in the programme ,so I would be able to display a function for example and after the display finishes the programme carries on normally like nothing happened and then that same key on any other push would still do the display . Thanks in advance
Plain C++ does not have any concept of "key binding". The platform (e.g., the operating system) has this knowledge and it provides some libraries to handle it. So, you must provide more information about the operating system, or use a cross-platform library like Qt.

How can I mix C/C++ with python? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to use C++ for opengl and python for scripting various social api calls. IS there a better option?
Prototype with your OpenGL calls in python - it is much quicker to prototype than C/C++ and then see if it is quick enough - if it is then you are done - if not then find the bottlenecks and consult the documentation on C/C++ plug in to address those issues.
Note that there are python OpenGL bindings available here which already use C/C++ on the OpenGL side so should be as fast as anything you are likely to come up with quickly.

Should i use inline function my program? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a 2500 line and 76.8 kb c++ console program. I learned inline function but heard about inline function makes a trouble in huge programs. Is it true? This program is huge or not. It can be a trouble in the future. What should i do or what is your suggestion for me.
Note:Program include lots of functions.
Thanks!
Is it true?
You can check out the advantage and disadvantages of Inline Functions and justify it

How to read files from a torrent file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to extract information about torrent file like: files names inside it, their sizes ..., is there a C++ library for Linux that help me achieve this easily? or what is the structure of a torrent file and how do I find these information?
You can use the libtorrent library—a feature complete C++ BitTorrent implementation focusing on efficiency and scalability.
If you want to write your own library, there is the official BitTorrent Protocol Specification but it is very poorly written and lacks a lot of details. There is also a much better specification available.