General C++ Programming - November 2016 (Page 21)

recursion problem
 
i am trying to figure our how a side would look if to find the the amount a number can by raised to without exceeding y. this is part of a big program and this ...
[5 replies] Last: // invariant: n, max_value are non-zero unsigned int max_pow_not_abov... (by JLBorges)
Deletion causes access violation
 
I have a linked list and a block of code that destroys it. For no apparent reason, I'm getting an access violation. Here's my code: case WM_DESTROY: { ...
[1 reply] : I thought the nullptr check was supposed to prevent access violations... (by AbstractionAnon)
Calculator
 
Hey guys, been trying to make myself a calculator and ran into some trouble lol, if you guys can spot the problem i'd be thankful :) #include <iostream> #i...
[3 replies] Last: Don 't double post - see your replies on a separate subforum. (by lastchance)
HELP! Please :/
 
thank you!
[4 replies] Last: I think the OP is supposed to ask for a number of $s to output 5 times... (by edge6768)
Inserting a temporary std::string into a set: is it a dangling reference or a copy?
 
Hi, The simplest question. I have the following scenario: class container { std::set<std::string> names_; public: void make_current(const std::string& s)...
[3 replies] Last: It's a copy. You can't store references in standard containers. (by mbozzi)
How do I Print my array and my sums?
 
#include <iostream> #include <iomanip> #include <fstream> using namespace std; int main() { cout << "Kaitlin Stevers" << endl; cout << "Exe...
[6 replies] Last: I did... Maybe it's because I'm using an iMac. I've had trouble before... (by JANET2016)
Element-wise max between two arrays
 
Hi guys. I think my question is pretty simple. What is the best way of making element-wise max operation on two std::array s in c++? Example: array1 = ...
[3 replies] Last: Great mbozzi!!! This is what I was looking for: This is the code: ... (by dariodem)
redeclaration of function that isn't there, etc
 
all of these error messages seem to be bogus. but I don't know what to so with them. can't get past them. (gcc) f:\prj\lib\strfuncs>type err.txt strfuncs.m...
[4 replies] Last: It is occasionally helpful to run (only) the preprocessor over your so... (by mbozzi)
Loop not working
 
The issue seems to be when I go into the menu it works the first time (say you hit pasta) but then when I want to order something else if I choose the same opti...
[7 replies] Last: Thanks for your help guys, I figured it out. I simply too the boolean... (by closed account 4wvoLyTq)
by saydi
Can anyone solve it please !
 
Q1 ) What is wrong with the following if statement (there are at least 3 errors). The indentation indicates the desired behavior. (Check it either manually or b...
[3 replies] Last: Hey Saydi, Try to write your code and if it does not compile for you o... (by M B)
Reading a file into an array that is 10 by 10
 
I'm trying to figure out how to read a list of numbers from a file into an array that has 10 rows and 10 columns. Here is what I have so far. #include <iost...
[13 replies] Last: http://stackoverflow.com/questions/40411440/reading-data-from-a-txt-fi... (by closed account ENhkSL3A)
by sigsal
mixed factorial sum in loops
 
I need to do a mixed factorial sum, using loops, to calculate: 1! x (5^max) + 2! x (5^(max-1)) + 3! x (5^(max-2)) + 4! x (5^(max-3)) + ... + max! x (5^1) (Ex...
[1 reply] : Can't help much without looking at the code. (by helios)
number systems
 
Number systems are ones tens hundreds thousands ten thousands hundred thousands millions ten millions hundred millions billions ten billions hundr...
[1 reply] : you can jump from thousands to millions by 1000 x 1000 but you have to... (by closed account oz8kSL3A)
Output display help
 
Hi this is my code. Question? how would I display the information from option 3 to come out in option 5? what am I missing ? #include <iostream> using n...
[2 replies] Last: When I enter 3:: Enter your choice and press return: 3 options Cong... (by animation117)
Default constructor/destructor in NonCopyable class
 
Here is a compiling piece of code: #ifndef NONCOPIABLE_H_ #define NONCOPIABLE_H_ class NonCopiable { protected: NonCopiable() {}; ~N...
[2 replies] Last: Thanks! (by BobMorane)
by kellyM
how can i have a return with my various if statements?
 
//function required to have a return. char update(const char grid , int N, int Row, int Col, int ageGrid ){ int countB, countF, countR, countG; if(gri...
[3 replies] Last: Yes, obviously, but what do you want the value of that char to be, if ... (by MikeyBoy)
Read two words in one element of array
 
So I need to have my program read in two words into a single element in an array from a data file. So say I have this file named names.txt and it has 1.joe Er...
[3 replies] Last: Tabs (both horizontal and vertical) are also considered whitespace (by gunnerfunner)
Two dice simulator not working
 
Unfortunately not working. Can someone guide me in the right direction Requirements: (1) Create a function that simulates a throw of two dice. Hint: Create a...
[3 replies] Last: OP: you need to set the seed for rand() so that it doesn't generate th... (by gunnerfunner)
Using pointer notation and array notation
 
Description: We have to use pointers (no structures). Ask user how many test scores they will be entering. Error trap for + input. In main, dynamically allocat...
[10 replies] Last: Thank you everyone who helped. Here is my final, working code. #inc... (by Miraclefruit)
by Gyiove
Dynamic array perhaps having a secret data?
 
Hello everyone, Here we have simple dynamic array: int *p = new int ; // creating/allocating array p = 1; p = p + 1; delete p; I always won...
[2 replies] Last: > its like there's some extra data behind the address where the real v... (by JLBorges)
November 2016 Pages: 1... 1920212223
  Archived months: [oct2016] [dec2016]

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