Beginners - April 2016 (Page 4)

printing whole numbers as double
 
I am trying to print a whole number as a double, using set precision and it does not work. It works for double number but not for whole numbers. #include <io...
[2 replies] Last: Thanks a lot that worked :) (by funprogrammer)
Stop Working
 
Stop working when i'm executing an FILE in prompt. Stop working when i'm executing an FILE in prompt. #include <stdlib.h> #include <stdio.h>...
[no replies]
See whether a point is in a triangle.
 
I've been trying to solve a problem which states the following: Write a program, which, given the coordinates of a point, and the coordinates of the 2 remaining...
[4 replies] Last: You did a nice job tackling this in terms of line equations and inter... (by closed account D80DSL3A)
by csnook
Visual Studio Debug Assertion failed?!
 
Visual Studio throws and error with this code but web based compilers run it just fine? Specific error in VS is Debug Assertion failed! Expression: string itera...
[no replies]
by Phil15
Assignment operator
 
Hi I had a question not so long ago and I am not sure I answered it correctly.. Write the assignment operator for the String class. Keep in mind the memory...
[3 replies] Last: My bad. I thought I saw a size member somewhere. The code is correct e... (by helios)
 
[2 replies] Last: I did not put all of my code on here because it was too long I was jus... (by Batman93)
SFML and QT Creator
 
Hey guys!! For the last couple of days, I have been trying to setup SFML on my QT creator (5.5). I have been running through many different errors and whenever...
[no replies]
output file
 
i am trying to output my file into a chart form but when i output the information is not all on the same line void outputArray(element elements , const ...
[no replies]
Help PLease
 
I've been completely stumped by this problem and could someone explain the step to achieve the final answer? #include <iostream> using namespace std; int...
[2 replies] Last: What is the output is the question and the answer is 8 2. how is it so... (by stevenglo300)
Need help with output - Menu item number will not increase and doesn't display correctly after first iteration
 
My code: (line 58-62 is the problem) #include<iostream> #include<fstream> #include<iomanip> #include<string> using namespace std; const int FOOD_...
[no replies]
weird typedef explanation
 
Hi, I'm reading one C++ book and in one example there was this very weird typedef that I have no idea how to use and what exactly does it mean. It was not the i...
[6 replies] Last: Tnx man for making this clear. I actually thought that besides making ... (by etrusks)
How do I use my void function as a class?
 
I am trying to understand classes. I'm supposed to use my login system as a class. I don't know what the difference would be between using a class an just invok...
[no replies]
Copy words from text file into array
 
I have a textfile that I'm trying to copy each word in the file to an individual element in an array, then output the contents of the array to the screen. My c...
[1 reply] : So I edited my code and now I'm getting each letter of each word to co... (by reppin541)
Help Analyzing Simple Code
 
Could Someone Please Explain How 3 is the answer? #include <iostream> #include <string> using namespace std; int main() { int ctr = 0; int myarray ; ...
[no replies]
Sorting in a table?
 
If I have a table of 75 workers in a table set up as such: workerTable wt ; where the workers have the following info saved to them: char name ; double...
[no replies]
Sleep() function generating random numbers on couts.
 
Apologies for posting so many lines of code. Whenever I run this testing out a function. It appears I get a random number after the sleep function is used and i...
[2 replies] Last: NEVERMIND! It actually had nothing whatsoever to do with the sleep fun... (by FreshBoi22)
Ctor takes 1 arg yet able to declare an instance without args
 
Hi I have a very simple class named Vector, which can store a specified number of doubles. (This example is from Stroustrup's book). The class is a handl...
[4 replies] Last: My question really was why the problem doesn't occur when the ctor is... (by Moschops)
Payroll class help!
 
Design a Payroll class that has fields for an employee's name, ID number, hourly pay rate, and number of hours worked. Write the appropriate accessor and muta...
[1 reply] : This is my updated code! #include <iostream> #include <string> #inc... (by Unisaurus)
How to setup a linear/binary array search for a shopping program
 
So my program is a book store, and I have to create a linear and binary search function that will search for the book ID, the price of said book, and how many t...
[3 replies] Last: I did not say: "use std::find". I said: "read". The std::find does no... (by keskiverto)
April 2016 Pages: 123456... 43
  Archived months: [mar2016] [may2016]

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