Beginners - February 2018 (Page 25)

Compiles but not outputting everything (enums & classes)
 
I have to write a program that takes in 2 numbers (in millions of years) and outputs the geological time frames encompassed in those two numbers. I have the fil...
[2 replies] Last: That is exactly what I want it to output! For me it does not show the ... (by Toasthat)
Why does this program segfault?
 
I have this project for a class and the program is to print out a randomized sequence of the numbers from 0 to 9, Using a really dumb algorithm. I need to find ...
[4 replies] Last: So far, lines 15-19, it looks like you're trying to make an array of ... (by icy1)
Help with my switch/case
 
I'm using a switch/case structure to operate a menu. The menu works as intended, with 1 exception. It ignores the first entry. You can input any integerr the...
[6 replies] Last: Thanks very much icy... your suggestion made me think about it slightl... (by Dyelynn)
by dubley
this pointer related question
 
Hello, in the code at line 50, const Stock & Stock::topval(const Stock & s) const what is s? I do not understand what the argument being passed to s is. I a...
[2 replies] Last: Thanks very much for your reply. This is an adaption of another progra... (by dubley)
How to print only first and last words of a string
 
I am trying to create a program that will allow a user to input their full name (middle name included), but then will output their first and last name only and ...
[3 replies] Last: If you don't need to slice up a string here's an easy way s... (by Boilerplate)
Do While loop returns INF
 
I'm trying to make a compound interest program for an assignment that tells me at what point Bob's compound interest will catch up with Alice's flat, higher int...
[4 replies] Last: @Elarionus, I think you had better post your modified code. We aren't ... (by lastchance)
error: no match for operator >>
 
the code: https://i.imgur.com/bPwl3US.png the error occurs at line 30 thanks for any help!
[1 reply] : The key array contains pointer to strings. The stream does not know ... (by coder777)
Inheritance Question
 
Hello Community, I currently try to solve a programming problem involving inheritance of multiple classes. Here is part of the problem statement: Write a...
[6 replies] Last: TheIdeasMan thank you for sharing this! I will certainly try to learn,... (by Misenna)
needing some help overlapping two functions
 
I'm currently writing a minesweeper program and have come to a hault due to not being able to get my mine array to be printed into the grid. any help or poin...
[12 replies] Last: Managed with the help of a friend to get it searching the array within... (by binaary)
How to read one text file and store that in one variable in C++?
 
I am trying to read one text file and store all data from that text file into one string variable but how can I do that? string ch; ifstream file("E:...
[8 replies] Last: That's the one - thanks (by mbozzi)
Help with reading a file to an array
 
Hello, I'm working on some code for school and ran into an issue. The assignment is as follows: "Write a program which reads the numbers.txt file (availabl...
[3 replies] Last: Thank you both so much! I took my first programming class over a year ... (by cjmay2013)
different ways to call constructors
 
Greetings, may i ask whats the difference between calling Class instance(stuff); and Class instance{stuff}; ?
[5 replies] Last: you suddenly killed my enthusiasm and brought me back to the classic ... (by mbozzi)
mkdir not detecting if directory exist
 
on the first pass it detect if directory exist when it go true the routing again it doesnt #include "stdafx.h" #include "Plugin.h" #include "...
[2 replies] Last: strcat(t5d, "D:\\output\\"); should be strcpy I never cleard t5d dumb... (by nickhere)
Pointer arithmitic
 
So this is a pretty basic question but it had me thinking so I guess I will go ahead and ask it so with my code as the example below I created three strings an...
[1 reply] : > or is this just by chance that this is happening? Yes. The program ... (by JLBorges)
Vector
 
Hello, what are the differences between vectors and arrays? When to use one or another? Thanks!!
[1 reply] : A vector is a proper C++ container object. It will resize as needed, a... (by Repeater)
Need help with my C++ Assignment
 
This is my assignment: Program Specifications Write a program that will read movie titles from files and echos (or prints) them to common input. The program ...
[4 replies] Last: Get the code to work with one file first, then add the loop and menu s... (by dhayden)
by sb99
Why is the result/remainder not shown.
 
I can input number1 and number2, however the result or remainder is not shown. I've seen the word "buffer" thrown around in places with regard to cout cin, but ...
[2 replies] Last: It appears using visual studios default headers fixed the issue. It no... (by sb99)
by flav32
set precision without std::cout
 
Hello! I have a floating point number from which I have to output only the decimals. The problem is that my teacher wants us to output 20 exact decimals from th...
[7 replies] Last: Look at JLBorges's solution. (by dhayden)
Help with set/get functions!
 
Okay this is for an assignment that I have gotten a decent start on. I am confused in a few sections but mostly with "if" statements and get/ set functions. I h...
[8 replies] Last: You can simplify your "display" by using std::setfill() and std::setw(... (by jlb)
by sqed98
Dynamic Array
 
This is the code im working on for my cs3420 class. I really don't understand dynamic arrays. I cant figure out why I am getting a HEAP CORRUPTION DETECTED erro...
[1 reply] : One problem is in your copy ctor container::container(container &c) ... (by Thomas1965)
February 2018 Pages: 1... 232425262728
  Archived months: [jan2018] [mar2018]

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