Beginners - December 2016 (Page 24)

Program wont run properly
 
Heres what the program is supposed to do: Write a program that will read data from the file "p6.dat". The file (that you will create) always contains 15 test s...
[1 reply] : Your results give the impression that the program didn't find the data... (by lastchance)
Why can i tokenize string passed as function parameter but not string retrieved from getline?
 
The problem I have is that I am able to successfully tokenize the string parameters which are input into my function menucall, but using the same method I canno...
[5 replies] Last: I have to apologize, I feel really stupid now. There is nothing wrong ... (by Carsomyr)
by rlake
Getting nullptr error when trying to delete a node from a binary tree
 
Hello, I am trying to delete a node from a binary tree and am getting a nullptr error. If anyone would please give me some pointers on what to look for, I w...
[2 replies] Last: Thanks! (by rlake)
function call does not work.
 
I have a program to take in call times from user, then calculate the call cost. When i call the callCost(), program gives me 0 as cost irrespective of call ti...
[4 replies] Last: Hello Andy, Yes, it was the logic. When i tried initializing price to... (by longberns)
by Carito
List as a Class attribute.
 
Hi! First of all, please excuse my english level, it's not my native language. Now, I'm creating a class and I have an attribute that has to be a list. My cl...
[1 reply] : By the time the complier reaches line 14 of your header file it would ... (by gunnerfunner)
hide vector implementation
 
Hi I am attempting to hide the fact that a class is using a vector to hold the data. I need to do so without creating a proxy class, which I have seen is str...
[4 replies] Last: OP: I think you might be looking for the pointer-to-implementation (Pi... (by gunnerfunner)
What does this expression mean?
 
Below is the JOSEPHUS round table sample codes I am studying. The for loop expression "for(int s=m-1;s--;r=p,p=p->link);" is unusual to me. Shouldn't "r=p,...
[no replies]
max element of numbers
 
I calculate palindrome and i'm need found max element of this list using namespace std; bool checkPalim(int); struct myclass { void operator()(int...
[1 reply] : struct myclass serves no purpose in this program and should be removed... (by gunnerfunner)
Stack reached by divide et impera programm
 
Hello everyone. I have a question regarding the stack of this programm: #include <iostream> using namespace std; void hanoi(int n,char a,char b,char c...
[no replies]
by rh3323
Overload function for net pay of three type employees
 
Need help on an assignment to create and pass overload function for calculating net pay with deduction for 3 type of employees. I got the gross pay function wor...
[no replies]
Need help in Assignment very fassst
 
Write your question here. 1.Calculate the amount to be paid in a supermarket after discount. Depending on the amount to be paid, the discount will be cal...
[3 replies] Last: i need help in first one only guys plz helpppppp meee (by ericashraf)
Input file with string and intinto int array
 
was wondering how you would put integers from an input file that contains strings into an array. The input file format is Exam1:000 Exam:000
[1 reply] : If you only need the integer, but not the string, you might do fi... (by Chervil)
An idea for data cluster
 
Lets say I want to create a program to store x/y/z's daily expenditure on a daily basis. The idea that I had in mind was something like the structure below. ...
[1 reply] : You'd be looking at some form of hashtables aka unordered map (unique ... (by gunnerfunner)
Cards against Humanity code.
 
The game has 4 rounds. I've stored cards assigned to each player in vectors. How would i create rounds in this game? Would i create a loop in the main function ...
[no replies]
This basic neural network keeps returning NaN
 
I'm using this project to teach my self C++ and it mostly works but if I give is any amount of varying input it just outputs NaN and variables become monstrousl...
[3 replies] Last: One of the commonest reasons for getting NaN is dividing by zero. Your... (by lastchance)
reading in text files with arrays
 
I have a lab that is almost complete but I'm stuck with a minor problem that I can't seem to figure out. Any help would be greatly appreciated. Lab: The lo...
[1 reply] : On line 52, if you're going to get the bowl number back to 0 just set ... (by boost lexical cast)
Cin Being Skipped
 
My code is below. The first getline prompt is being skipped entirely, but the second is recognized by the program. I have tried cin.clear() already. Any suggest...
[4 replies] Last: Cout what the user entered right after its entered to debug and check ... (by MistahMoose)
Limiting Integer Input from User
 
Hello all, I have been given an assignment to accept an 8 digit id in the form of an integer. I was wondering if there is a way to limit the user's input, or to...
[2 replies] Last: Thank you so much this worked and was very helpful!! (by closed account yh7EwA7f)
by years
press enter to continue
 
Back, again ^^; So basically, title. How do I make it that there is like a 'break' in the text. I'm aware of the following: cin.ignore(); and my prob...
[8 replies] Last: cin.ignore() is often used with cin.clear() to handle stream errors. H... (by Patagon)
Two Dimensional Array help
 
Hi guys, So each column represents a student, and the row represents the three students exam grades. What I'm trying to do is assign a user input student num...
[3 replies] Last: Yes, your can. Don't forget that if you want to add more than 3 studen... (by closed account 48T7M4Gy)
December 2016 Pages: 1... 2223242526... 28
  Archived months: [nov2016] [jan2017]

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