Beginners - February 2017 (Page 35)

by wolfv
How to pipe output to less instead of cout?
 
I wrote a C++ program the generates and displays a summary to cout. The summary is long and it is inconvenient to scroll and find the top of the summary in the ...
[4 replies] Last: I haven't thought of that. I will output to cout. Thanks dhayden. (by wolfv)
by Bizzy
Improper outputs/stringstream help
 
I am so close to finishing my program for school but I've hit a problem that I really have no idea what's going on. The function determineDayOfBirth is supposed...
[4 replies] Last: Taking a closer look at your code... In the conditions in printDayOf... (by cire)
drink survey
 
So I am able to run the program but it does not add up all the selections. Everything else works. [//This program collects survey data from a few people and ...
[6 replies] Last: Never mind I found my mistake.... Just had to move a couple of curly b... (by Amarilis)
Stuck on Homework assignment (Converting pennies into least amount of coinage.)
 
Hello so currently I am to the point where my program shows the amount of dollars and quarters that are in the bag of pennies. It calculates the amount of penni...
[1 reply] : So tell us how you have made the calculation by showing us a small pro... (by closed account 48T7M4Gy)
by Bizzy
Uninitialized Local Variable
 
So apparently this function receives errors after the first "if" statement saying "uninitialized local variable 'yearEntered' used" although I thought it was in...
[8 replies] Last: http://www.cplusplus.com/forum/beginner/207530/ (by closed account 48T7M4Gy)
by Bizzy
Valid Date issues
 
Okay, so now I have a new problem. The Gregorian date checker works with real dates, but I need to also use a function isValidDate to make sure that no incorrec...
[3 replies] Last: http://www.cplusplus.com/forum/beginner/207530/ http://www.cplusplus.c... (by closed account 48T7M4Gy)
by ar2007
vector memory leak
 
Hi. I try to create a simulation of a Big Num class, dividing the result in single digits, which represent the elements in the vector "dgt" for each item of "c...
[9 replies] Last: solved !! in line 252, (for loop) I had forgotten a "-1", which on pap... (by ar2007)
Sending more then one result from a function to main
 
How to get 2 or more result from a function to main? int *values(int k,int p) { int *ptr = NULL; int interest = k*(p / 100); int credit = interest ...
[10 replies] Last: You are a wise man Abstraction :D (by spax1111111)
How to keep the turn the same
 
I have a tic tac toe game but whenever someone makes an invalid move, they lose their turn. This is my game loop while(o<9) { play(t, turn); bo...
[4 replies] Last: To avoid crashing the program, play() should check the value of pos be... (by dhayden)
Trying to convert numerical grades to letter grades
 
Firstly, thank you to those who may be able to assist me. I am doing an assignment in which I have to convert numerical grades into letter grades. I am trying t...
[1 reply] : Is that return at line 167 in the correct place? Shouldn't it be outsi... (by jlb)
queue structure - linked list - empty element
 
Hi, I had to make a queue structure using linked list. (code below) My next task is to change it, to have empty node in front and in the end of the queue. ...
[3 replies] Last: Well tell your professor that Dave on cplusplus.com says he's an idiot... (by dhayden)
Improve the speed of my program
 
Write your question here. I'm new to c++ and here i have a simple program which works but the site of our university does not approve of it because it works m...
[7 replies] Last: Thanks it worked , it took me some time to understand it but now it se... (by NOSgraf)
fstream ios::
 
Hi. I'm having trouble understanding ios:: fstream.. When i use ios::app, i can open any new file even if it does not exist in my folder and it wont display er...
[4 replies] Last: thank you!!!! im sorry for the silly questions :'( (by weirdo123)
Function for finding Euler's Number
 
For some reason, when I execute the program, it'll always give me an answer close to "1.7". Can someone explain what's wrong with my program? #include <iostre...
[1 reply] : You didn't initialise sum, so you missed the first term in the series.... (by lastchance)
Deleting a pointer
 
Why can't I delete this pointer? I'm trying to delete a member in a list. struct Node { int value; Node *next; }; int main() { Node *start ...
[7 replies] Last: yes it does thx a lot :D i have a new topic on pointers so if you'r th... (by spax1111111)
I didnt see what mistake is here :/
 
"C:\Users\CosminPerRam\OneDrive\CosminPerRam Stuff\Projects\C++\Code Blocks 16.01\Mine\MultiIfs\main.cpp|46|warning: suggest parentheses around comparison in op...
[2 replies] Last: yes, it worked, thanks! (by CosminPerRam)
15/4 equals 3?
 
Hi, I'm confused when the output given to me is 3, when I want it to be 3.75. I know if I do 15 %4 I would get a 3 but why would the following code also output ...
[1 reply] : Put a decimal point after 15 thus 15./4 http://stackoverflow.com/ques... (by closed account 48T7M4Gy)
Temperature conversion table
 
Hi everyone. I'm fairly new to C++ and I'm wondering if anyone can help me with this code. My assignment was to write a program that creates and displays a tabl...
[3 replies] Last: I have done this for Dr. Tyson Mcmillan, in Fort Worth,//Program creat... (by cameronTX)
#include mess, errors when including a file
 
Alright so I'm making something, and I've got quite a few .h files. Usually I never really have had issues with them, but right now when I #include spawner.h or...
[3 replies] Last: You probably need to forward declare something rather than including t... (by Zhuge)
Basic String Manipulation
 
The user will enter a string with a length of at least 5 characters. Next, the user will input an integer representing the starting index of a new sub-string of...
[2 replies] Last: the user will input an integer representing the starting index of a n... (by Hengry)
February 2017 Pages: 1... 3334353637
  Archived months: [jan2017] [mar2017]

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