Beginners - March 2016 (Page 19)

problem with converting data types
 
I just started, so I am having a hard time learning C++. I have no experience in any other language. I have been reading some textbooks and I tried to put thi...
[1 reply] : You should use " instead of “ around strings. (by Peter87)
Need HELP!
 
This is my prompt: Prompt, input student's name (first name only, which will consist of one word only) and score. C&d on input failure. Let's say that the scor...
[2 replies] Last: Thanks so much! (by noob1234)
by skhjr
Limit on check writing
 
I am trying to make a bank program. I am required to limit the amount of checks someone can write in a month. The number of checks the person can write in a mon...
[5 replies] Last: I would initialize it in your setCheckLimit() function, and I think yo... (by mgoetschius)
Searching Hashed Values in Hash Table
 
I'm working on a programming assignment where I need to implement Quadratic Probing to create a hash table with the states of the United Stated and keeps track...
[1 reply] : However, there seems to be a problem with the search function, becaus... (by cire)
template declaration
 
Please explain the difference between the two following template definition: template <typename E> // base element type class Position<E> { // ...
[1 reply] : The first code snippet is of a so-called template specialization. Like... (by xismn)
by MrPain
Using iheritance or not with buttons
 
So in my case I'm having a class "Button" witch holds functions which are called when button is pressed. The only thing that button does is that it's calling fu...
[1 reply] : Option B sounds like you're trying to reinvent the factory design patt... (by xismn)
how can i make my code accept 2 digit numbers?
 
So my code works for the most part. It is supposed to take in 8 numbers from the user and then pack them into a single integer. Then it is supposed to allow the...
[1 reply] : I would approach this differently. 1.) Create an array of ten integer... (by xismn)
by Steps
My double keeps getting rounded
 
One of my assignments is to calculate the interest on a mortgage payment. Everything is fine except the mortgage principal balance keeps getting rounded. I w...
[1 reply] : http://www.cplusplus.com/reference/iomanip/setprecision/ (by keskiverto)
by WhatIf
How to include especial characters in a string?
 
I want to format text using html tags but I can't figure out how to include special characters in a string. std::string preHtmlTags = "<html><head/><body>...
[1 reply] : Use the double-quote escape sequence (\") to insert double-quotes: s... (by xismn)
by pang
Help with pointers
 
I need your help. With this code, I get these results: 1)a=3,b=9,c=14 2)a=3,b=3,c=6 I understand the first one. But not the second one. Isn't it supposed...
[3 replies] Last: If variable, (say "a" in this case) is defined in-scope it is local to... (by eraggo)
looping cost calculator
 
I am learning how to code pretty much entirely on my own, I have a very simple program right now that calculates cost of a package based on weight, however I am...
[2 replies] Last: That comes close however it keeps the 3.00 charge up til 20 then keeps... (by treassach)
Reading and writing from a file
 
Write your question here. #include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main() { ifst...
[1 reply] : Basically you need to create a output file (ofstream) and in the loop ... (by Thomas1965)
C++ Beginner help
 
I need help with this particular programming assignment. Here goes. Ask the user how many students are in a class. Using a loop, the application should read...
[9 replies] Last: Thanks for all the help guys. I truly appreciate it. Here is the final... (by FreshBoi22)
The textbook's Graph example won't compile
 
NOTE: This is not my code. It is example code I am learning about graphs and I want to run the textbook's Graph example on visual studio but It doesn't compile...
[no replies]
finding a line number in text file and replacing it?
 
Ok I have two text files of 20 different numbers called test and test2. So what I want to do is generate 5 random numbers 1-20 (which i did) and these numbers a...
[4 replies] Last: thanks again I'll try it your way with vectors! :) I understand it bet... (by misslyss)
Merging Files Beginner
 
The program is not actually merging the Files. It just output "Master File Updating Starting" and stays there forever. #include <iostream> #include <fs...
[7 replies] Last: ok. Thank You I will write that on my notes. :) (by ambar16)
HELP!! Doing project using arrays
 
I'm working on a project for my introductory class using arrays. The project asks the following: You have 10 students. 1. Get each student's score (0 - 100)...
[2 replies] Last: Hello. I get the basics of the for loop. By grades its asking for the ... (by afrocoder)
Initialization to "nothing"
 
Q: How can you initialize something to ' '? I am reading Programming Principles and Practice Using C++ and many people say this is nonsense. // convert f...
[6 replies] Last: If you use C++11 or later the value is never unpredictable. The new b... (by cire)
constexpr/const dilemma
 
Below is some code the exemplifies the user of constexpr. Why could I not use "const" instead? constexpr int max = 100; void use(int n) { constexpr int...
[no replies]
For Loop of a copy vector
 
Did I copy my vector the right way? I don't know why this for loop won't run? // Example program #include <iostream> #include <string> #include <v...
[4 replies] Last: @jib Thanx man! I found my error! I forgot cout (by sadij97)
March 2016 Pages: 1... 1718192021... 47
  Archived months: [feb2016] [apr2016]

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