General C++ Programming - June 2017 (Page 2)

error: call of overloaded ‘discrete_distribution(<brace-enclosed initializer list>)’ is ambiguous
 
Hello People, I am trying to write a function that produces random indexes on the interval of indexes of a vector v (let's say [0 m)). The probability of each ...
[4 replies] Last: ... I do need v... #include <iostream> #include <random> #includ... (by gunnerfunner)
PPP2 Chapter 15 Exercise 3
 
Exercise Specifications: 3. Modify Fct from the previous exercise to take an extra argument to con- trol precision or whatever. Make the type of that argumen...
[no replies]
by Kalcor
Don't understand this.
 
Hello, I couldn't really understand what this problem wanted exactly and it's just confusing as hell. I am not a fan of geometry and any of that crap so if some...
[5 replies] Last: paste the formula here http://www.hostmath.com/ (by ne555)
Can you make a header file for this main ?
 
I had to make a header for this on my exam (sadly I failed): Make a program, which has the following usage: $ prog source target where ...
[1 reply] : I guess that template<class T, bool directed> class graph; then yuo ... (by ne555)
by Kalcor
This problem
 
She knows n coffee recipes. The i-th recipe suggests that coffee should be brewed between li and ri degrees, inclusive, to achieve the optimal taste. Karen ...
[9 replies] Last: Thanks that clarified it more to me! (by Kalcor)
Controling 4 digit 7segment LED Display using 74HC595 shift register
 
I'm having troubles trying to use two 595 shift registers to output numbers on a 4 digit 7seg display. Here is the date sheet:http://www.componentschip.com/d...
[no replies]
by i773
Is it possible to check if custom class exists (key) in map?
 
I'm trying to see if my map already contains a class of "Bar' in it's keys: //Foo.h map <Bar, int> inventory; //Foo.cpp bool Foo::CheckIfItemExists(Inventor...
[2 replies] Last: > I'm getting: binary '<': no operator found which takes a left-hand o... (by JLBorges)
by AMDA10
Macro expander
 
Hi, I am trying to understand GLEW. It wraps the opengl functions with the help of macro. Now this is convenient for development but is not for study purposes. ...
[1 reply] : https://stackoverflow.com/a/20032355 (by mbozzi)
C++ and custom extensions
 
I was wondering, if I have a custom extension(One not editable usually, and not set up with registry) like .thescriptergeek, could I still edit the file as if i...
[2 replies] Last: A file extension does not define the file format, it's just a hint to ... (by TheBeardedQuack)
what is the size of the string?
 
The size of string in DEV 5.11 is 8 bytes using sizeof() operator. But in case of Microsoft visual studio the size of the string is 40 bytes also by using size...
[5 replies] Last: You cannot rely on the size of course, but you can tell MS and gcc t... (by Cubbi)
by bigboy
Help with project
 
Hi folks, Browsed this forum for a while, been a member but don't post, but I need some help with a project of mine. I have been learning C++ off and on f...
[7 replies] Last: char findWinner(char tiles ) { for (size_t i = 1; i <= 7; i += 3)... (by dhayden)
Any web source for me to practice C++ threading?
 
I learned the basic ideas and examples about threading in C++. Now I want to do some practice. Is there any good websites or books for threading problems with ...
[3 replies] Last: Thank you. I have just ordered it on Amazon. (by landlord2017)
Part 8 of Person drill for PPP2 Chapter 15
 
I'll make a new thread for this here. Edit: Now I need help with number 8, "Read a sequence of Persons from input (cin) into a vector<Person>; write them out...
[6 replies] Last: #include <iostream> #include <vector> #include <string> void error(s... (by JLBorges)
Linked List Functions Trouble
 
I am experiencing trouble trying to create a unit test for all the functions in my Linked List. Mainly I'm having trouble with my insert function that builds b...
[9 replies] Last: Of course they don't change the code, they only show that's sth. wrong... (by Thomas1965)
if(!cin) and if(cin.fail())
 
I searched for it on the net and didn't find a straight answer. Does if(!cin) do exactly the same thing that the if(cin.fail()) does? Are they completely iden...
[5 replies] Last: What is the logic behind those numbers? (1,4,2) As many flags, they ... (by Enoizat)
by Kalcor
Getting maximum of an array without the use of any external variables
 
Is there a way I can find the maximum of an array without the use of nested loops / 2nd variable ? maybe or maybe not using swaps too depending on how possible/...
[7 replies] Last: > I meant the "max" variable we usually use, only allowed to use a loo... (by JLBorges)
I need some help with std::regex_match because I'm trying to use in a Chapter 15 dril in PPP2
 
The second part of the Drill in PPP2 Chapter 15, where you have to define the struct "Person". Namely, number 7 in the specifications: Modify the construc...
[2 replies] Last: Yeah, that sounds better. I'll use find() or find_first_of(), then. ... (by DragonOsman)
Looking for 2D game library
 
I'm looking for a library for a 2D game that has a coordinate system and gravity engine built in, preferably with object, collision, and graphics handling. Anyo...
[7 replies] Last: Only language I know ATM (by DiamondWolf)
Anyone can make this code
 
The running time of the program should be less than 4 seconds. Mina wants to go on a trip during the a summer vacation. She has to pay in advance sever...
[1 reply] : We can only help, we can't do the work for you. (by kbw)
Time complexity
 
Is it possible to make a time complexity function which will calculate the average running time of the following code: #include <iostream> #include <chrono>...
[2 replies] Last: I forgot to say... if the code runs in a loop normally the above works... (by jonnin)
June 2017 Pages: 1234... 11
  Archived months: [may2017] [jul2017]

This is an archived page. To post a new message, go to the current page.