General C++ Programming - November 2017

by cash
replace substr
 
How can I replace substr when using information from txt file to display on your file. string find_number(string line) { return line.substr(0, 6); ...
[4 replies] Last: With what? What role do the try-catch statements serve in your program... (by keskiverto)
by ADDDC
Errors for my programming class.
 
So I keep getting error LNK2005 in my program and there are these requirements for this program that are already coded. I can't get it to work and I have to sep...
[13 replies] Last: Thank you thank you thank you all!!! I appreciate all of your help for... (by ADDDC)
If given a threshold of 0.30 and a formula of #(A,B)/#A how can I compute the threshold value of each item in the data file
 
Below is my Association Rules Market Basket C++ Code & The Data File and Output #include <iostream> #include <map> #include <iterator> #include ...
[13 replies] Last: I did some major tweaks to my code int main() { list<ITEM_COUNT... (by mikewill203)
Need Help altering code to desired outcome
 
Hello all, I am having difficulties with one of my labs and am racking my brain trying to figure out what to do next. I have tried a while and if loops and c...
[1 reply] : there is no such thing as an if-loop, there are while, for, and do-whi... (by jonnin)
Struggling with forming a equation into a c++ equation that uses the values from my data file
 
The equation is Threshold x (number of transactions having both gum and bread)/(number of transactions having gum) Which in numerical form is 0.30(12/3)=1.2 ...
[3 replies] Last: yes! one way to do this a little cleaner is an enum: enum itemz { ... (by jonnin)
Calendar Reference
 
I found this code online while searching for a solution to something I wanted to do. I am wondering if it is possible to change this code to use it as a refere...
[3 replies] Last: Gunnerfunner, this is what I have so far. I was wondering why it won... (by RCUniversal)
Fixing this recursive function
 
Hello, I am currently trying to solve a programming problem. However, I cannot get this recursive function to work: void mergeData(vector<int> data) { for (i...
[5 replies] Last: Using recursion this way might hurt you sometimes as it leads to high ... (by benhart)
Need Assistant Quick - At home Project
 
I cannot produce the "other" to form the correct output. The "@" Should read as a other but doesnt and I'm having trouble with making my program read in from a ...
[1 reply] : else if (ch != '@'&& snippity) others++; ^^^ this reads "if it is NO... (by jonnin)
Average/ Problem with variable accessing
 
Hello! I need to find an average but... Here We have some data: 76.709999, 76.879997, 75.629997, 75.779999, 75.779999 76.900002, 77.639999, 76, 76.239998...
[1 reply] : how to access that one before last number from Container "point of vi... (by Chervil)
JUCE
 
Someone know if juce is open-source?
[2 replies] Last: https://en.wikipedia.org/wiki/JUCE (by coder777)
Custom iterators in c++
 
I have a collection of object of type "T" that i want to iterate through. An object of type "T" has two important properties: int r; // row number i...
[4 replies] Last: I would suggest not to use a custom iterator. Instead you may have a ... (by coder777)
emplace command in std::map
 
I'm having segmentation faults when I add something to a std::map with emplace. I have a map std::map<std::string, std::vector<uint8_t*>> mymap; and I add val...
[3 replies] Last: Yep sorry wasn't at home...here's the code. This is a testbench that ... (by jgreninger)
by wtbe
Average drop lowest C++
 
Hi guys. I'm currently writing a program that's supposed to find the lowest score drop it and also find the average. So far I have one more issue that I'm tryin...
[7 replies] Last: Works? Lets see what you have: #include <iostream> #include<iomanip>... (by keskiverto)
by polip
Arrays
 
How to avoid using global variables #include <iostream> using namespace std; void bookSeat(); void printAll(); void printBooked(bool val); int printLeast...
[7 replies] Last: What you're doing is can be very dangerous for your code as for high c... (by benhart)
Ajudem por favor...
 
Boa noite pessoal, não sei se estou no lugar certo, mais procurei e não achei um lugar melhor para pedir ajuda, me desculpem se n for aqui,sou iniciante em C+...
[no replies]
by AnxL
Can someone explain this code to me?
 
Hey I'm pretty new to programming, and for the semester we have an extra credit group project. It's about codingames's skynet revolution episode 1. <https://ww...
[4 replies] Last: ask your friends who wrote it how it works This. Communication withi... (by keskiverto)
by piotr5
ordering deferred instantiation
 
the following fails to compile in gcc7 since the compiler takes declaration-order as more important than instantiation order: ---------------------------------...
[6 replies] Last: probably should have mentioned: I use "g++-7.2.0 -std=c++17" Edit: to... (by piotr5)
Changing background color of a frame wxwidgets
 
hi guys I tried to set a background color of a frame in wxWidgets but to no avail,I get no errors or anything but when I try to change it it still remains the d...
[3 replies] Last: ahh ok I know whats going on I set the backGround color to green after... (by adam2016)
by cash
Convert to C++
 
Can anyone convert this python code to c++. from math import exp, expm1 import os #define variables: #define functions: def get_number(one_line): ...
[1 reply] : Please do not double post: http://www.cplusplus.com/forum/beginner/225... (by AbstractionAnon)
expected initializer before '<' token. template C++
 
//Buenas. tengo que corregir este codigo porque me da un error expected initializer before '<' token. no soy muy bueno en template. /*Programa corregido...
[1 reply] : Hi luedblra, A few things before people can answer your question: 1)... (by goldenchicken)
November 2017 Pages: 123... 16
  Archived months: [oct2017] [dec2017]

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