Beginners - February 2017 (Page 18)

My file is not being created
 
Write your question here. how do I create a file?! #include <iostream> #include <fstream> #include <ctime> // Needed for the true randomization #i...
[3 replies] Last: Line 22: cred is uninitialized. Line 25: You're writing an uniniti... (by AbstractionAnon)
Average of 3 numbers - displaying 2 decimals
 
I don't know how to display decimals. At the moment, the program shows integers. I need it to display numbers like 9.33 too. #include <iostream> #include <i...
[5 replies] Last: You can change it to: #include <iostream> #include <iomanip> #inclu... (by joe864864)
Can't figure out why this code won't work
 
I'm doing an exercise in a textbook. All I have to do is print and label 3 vectors. I have no idea why it wont work EDIT: Nevermind, I just realized that I tri...
[3 replies] Last: >would this be the most efficient way of printing the values of the ve... (by edge6768)
C++ problem
 
Hello, I have to write a program which displays all the numbers with 3 digits which have only 4 prime divisors. E.g.: 210, 330, 390, 420 etc. I've tried this,...
[2 replies] Last: Thanks a lot. (by forta2k)
by bp04
How to create a watchdog timer in C
 
Hi, I'm using 16/32-bit ARM microcontroller. I want to reset the controller after sometime say 10 sec using watchdog timer. The datasheet consists of the watch...
[2 replies] Last: Instead of the register name, the demo code uses the address. That d... (by mbozzi)
Employee Class #2 pg802 SOWC++ 8th edit.
 
So here's the thing...I'm still learning to deal with classes, I was told to do this program for class and so far I think I'm doing well, but i got completely b...
[2 replies] Last: This problem occurs because you're switching between the extraction op... (by jlb)
Terminating an option for a variable
 
Im trying to make my program so that after the user chooses an item to purchase they aren't able to choose it again. I tried using bool to make this work but wh...
[3 replies] Last: Line 12 does not accomplish that. It declares a new variable (with th... (by AbstractionAnon)
need help with while loop problem
 
I am trying to create a program where i would be able to calculate center of mass in 2-D. Everything has been working out fine with the code except it is giving...
[2 replies] Last: Thank you, i finally got it working properly. (by klknowles)
Issue with vector being out of range
 
I have a function which is supposed to write all the data from a txt file to a vector, and it comes up with the error, "Debug assertion failed. C++ vector subsc...
[5 replies] Last: usernames and passwords are not defined within the function but I'm gu... (by gunnerfunner)
Does anyone know how to do this homework question
 
A country collects taxes on the assessment of value of property, which is 80% of the property’s actual value. If an acre of land is valued at $100,000, its a...
[8 replies] Last: or you could read a more friendly to type value (borrowing from the ab... (by jonnin)
Delagating To A Linked List Issue #2
 
Hello I have an issue with my book. Here is the example. Header File http://pastebin.com/SghDkf48 Main http://pastebin.com/0b9EbNQG Output http://p...
[1 reply] : &Part::GetPartNumber gives you a pointer to the GetPartNumber member f... (by Peter87)
How to make this program? (PLEASE HELP)
 
Hi I have this assignment but I can't figure out how to make it. If someone could make a working program it will greatly help me. The input will be two line...
[1 reply] : One chess set object needs one Black object and one White object for c... (by gunnerfunner)
Menu Application Won't Compile
 
Ok, so I have a project for school that I've been trying to debug myself, but I can't get any further. This is a simple Menu application that will eventually be...
[8 replies] Last: This line doesn't do anything useful. using std::string;(this->mi .d... (by Peter87)
Array Class(Infinite Loop Error)
 
Hi, I'm a student and have been working with c++ for 1 year now.(please go easy on me) I am doing a homework assignment on array classes. The task is: Write ...
[2 replies] Last: Thank for the reply. It was a mistake on my part. I forgot to change i... (by kaungsint11)
Using string
 
Hello there, i having a small issue reading string of 01/6/2005 MM/DD/YYYY. how do i get it to read the rest of the dd and year due to the / ??? #inclu...
[1 reply] : You can use std::getline() with '/' as the delimiter. http://www.cplus... (by integralfx)
Dynamicc Array Resizing
 
I am attempting to write a program that allows a user to input values into a dynamically allocated array. The user enters a letter when finished entering intege...
[4 replies] Last: @Boilerplate - Agreed! This has been the source of many debates in th... (by gr8flmommy)
Two STL list & push_back
 
I have two list, how does one push_back elements from one list to another list? So I have to create a temporary list. Im limited to placing items at the back ...
[2 replies] Last: Dude you are a lifesaver. Thanks for the comments too, helps me unders... (by doctterdre)
Cannot write to file.
 
For some reason this piece of code won't write the info to the txt file. I've been looking for a while and can't seem to find anything. Does anybody have any ...
[3 replies] Last: What is the type of stream for userFile and passFile? And where are th... (by jlb)
by NateE
Exceptions Classes for Zero and Negitive
 
Receiving errors and I am not sure why. I am attempting to add exception files for zero and negative. My program was working until I attempted to add these file...
[9 replies] Last: 1-insert: Rectangle(); on Rectangle.h 2-insert: using namespace std; o... (by ar2007)
by Meden
Class functions are not working
 
Why does my code not execute correctly? HeartRates.h #include <iostream> #include <string> #include <cmath> class HeartRates { public: void se...
[1 reply] : I finally figured it out, after 30 minutes of staring at it!!! http:/... (by smartypantzss)
February 2017 Pages: 1... 1617181920... 37
  Archived months: [jan2017] [mar2017]

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