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); ...
Nov 30, 2017 at 9:07pm
[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...
Nov 30, 2017 at 7:56pm
[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 ...
Nov 30, 2017 at 7:42pm
[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...
Nov 30, 2017 at 6:31pm
[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 ...
Nov 30, 2017 at 4:35pm
[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...
Nov 30, 2017 at 4:18pm
[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...
Nov 30, 2017 at 3:53pm
[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 ...
Nov 30, 2017 at 3:01pm
[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...
Nov 30, 2017 at 10:46am
[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?
Nov 30, 2017 at 10:13am
[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...
Nov 30, 2017 at 9:03am
[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...
Nov 30, 2017 at 5:58am
[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...
Nov 29, 2017 at 11:55pm
[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...
Nov 29, 2017 at 11:16pm
[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+...
Nov 29, 2017 at 10:48pm
[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...
Nov 29, 2017 at 10:15pm
[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: ---------------------------------...
Nov 29, 2017 at 9:44pm
[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...
Nov 29, 2017 at 7:44pm
[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): ...
Nov 29, 2017 at 5:50pm
[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...
Nov 29, 2017 at 2:23pm
[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.
Registered users can post in this forum.