Beginners - May 2017 (Page 18)

Modularizing
 
This is my first time trying to modularize in C++. I'm confused as to what value returning functions are compared to void functions, and when to properly use on...
[3 replies] Last: I'm used to programming in Java and not worrying about if I have to r... (by mbozzi)
why does this simple function not work
 
So I'm just trying to learn C++ and Visual Studio is apparently not wanting to work for me. What is wrong with this code? #include <iostream> using name...
[12 replies] Last: be sure you did a rebuild all in your project. The other options can... (by jonnin)
by shinxg
how to output the elements of a vector on one line?
 
how to output the elements of a vector on one line? for(int i = 0; i < result.size(); i++) { std::cout<< result ; std::cout.flush...
[4 replies] Last: return indices of the two numbers such that they add up to a specific... (by gunnerfunner)
trouble with, if statements
 
can someone please help me understand why my code keeps returning 0 for my taxBracket variable? #include <iostream> using namespace std; int computeTa...
[1 reply] : if (0 <= yearlyIncome < 15100) taxBracket = 10; if (15100 <= yearlyIn... (by chicofeo)
polymorphism and pointer arrays
 
i cant do this? Domestic *bucketPets = new Puppy; int menuarray = {new Puppy}; //i want to make a menu for my 4 classes all inherited //dog cat ki...
[5 replies] Last: i want to make a menu now //my beginning of my pointer to array menu... (by seungyeon)
by darje
cant understand why this program not runing
 
Write your question here. main #include"ArrayList.h" #include<iostream> using namespace std; template<class T> void func(ArrayList<T>&object) { in...
[11 replies] Last: ¿what's the rationale behind this `run anyway' option? I'm not sur... (by cire)
by Chamat
Why is this corrupting the stack?
 
I have an array of integers, and an array of booleans in which I'm trying to set the boolean values to true to a corresponding integer value. For example in ...
[2 replies] Last: A silly mistake on my behalf, thank you. (by Chamat)
(1.0/a*a) vs. (1.0*a/a) - what is the difference?
 
(1.0*a/a == 1.0) (1.0/a*a == 1.0) they all output 1. but the first bool output true, while the second bool output false. i think it's about t...
[8 replies] Last: I gave the explanation before testing the program. When I did test it ... (by Chervil)
Issue with program
 
So I'm learning about if and else structures right now and for some reason my program that I'm working on won't accept one of my strings whenever I try to use a...
[7 replies] Last: Hello blahblah123, You should initialize all your variables when you ... (by Handy Andy)
by Kiryu
Delete std::vector with non-pointer ob jects when deleting Class
 
Hey, I'm new here! :) I'll jump right into it! I'm writing a game with a minecraft-style world. Minecraft stores all it's blocks in a 'Chunk' system consis...
[7 replies] Last: I don't remember if I have used this, but I've heard of it: https://gi... (by mbozzi)
Sum of rows and columns in a matrix
 
I have an excercise with the following statement: "Read through the keyboard a matrix with size 10x10, display the sum of each row and column of that matrix". ...
[3 replies] Last: You had it to begin with. srand(time(NULL)); //different every run ... (by jonnin)
compare f a number is less,equal or greater than 10
 
what is the pseudo code for comparing if a number is less than,eaqual to or greater than 10. Thank you in advance i got the code but as a beginner i want to kn...
[2 replies] Last: what is the pseudo code for comparing if a number is less than,eaqual ... (by elabass)
help on an assignment
 
Hi i need help on an assignment im taking. my professor said : You are to create a program for a restaurant. Your program will only capture the meal sub...
[5 replies] Last: Thanks chicofeo for the help. very much appreciated. (by closed account y7p9z8AR)
Operation Matrix
 
I have a program that performs the operations of union, intersection and difference of sets. These operations are performed using the operators (+, *, -). I ent...
[3 replies] Last: How can I create such a matrix from 0 and 1, so that it works like thi... (by DimaMog)
Huffman algorithm
 
Hello. I have been using the forum for almost a year and always got help from people around here. The forum contributed greatly to my c++ skills, a language i ...
[3 replies] Last: The code was edited to use unique_ptr for memory management and namesp... (by globaltourist)
Needing some help with a text base game.
 
Morning. I'm a completely new programmer who hopefully plans on going to college this September, so I'm trying to get a good head start with C++. I've decided ...
[3 replies] Last: @moschops cheers for the help @Flaze I just found a tutorial. well co... (by binaary)
by supp
Strings and functions
 
Write your question here. #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <iomanip> #include <ctime> using name...
[3 replies] Last:  My guess is that it clashed with std::function (http://www.cplusplu... (by gunnerfunner)
When Compiling, Value Not What It Should Be
 
EDIT: I realized what was wrong. Thanks anyways. My assignment is the following: Design a class that has an array of floating-point numbers.The constructor sh...
[2 replies] Last: don't set a value for small on line 42 (by boredsatan)
Expression must have a modifiable lvalue
 
What's the problem with this code? I want to make a prime checker I use the following formula If a number nr is prime, than this equation will be true (nr-1...
[1 reply] : = is not the same as == Do not use = when you meant to use == ... (by Moschops)
by xxvms
clarification
 
I have small puzzle, with operator || and &&. when I tried to break from do/while loop I tried this condition while (ans != 'n' || ans != 'N'); ...
[8 replies] Last: Hi, Not constructor, that is a different concept. Perhaps I should h... (by TheIdeasMan)
May 2017 Pages: 1... 1617181920... 24
  Archived months: [apr2017] [jun2017]

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