General C++ Programming - April 2017 (Page 13)

General OOP Questions(2):
 
1) Can objects of one class use the members of another class; without inheritance. 1b) If so, how often does your average schmo of a programmer (Beginner) do ...
[1 reply] : hot off the press, earlier today's: http://www.cplusplus.com/forum/beg... (by gunnerfunner)
Code needs to be edited cant figure out what to do
 
Hi all So i have written a code that produces a statement for a customers bill. It gives discounts and such to different customers. However when my code asks f...
[2 replies] Last: It does not let me input the customer number. Similarly when i type ... (by Beyond Humanity)
Store input file containing matrix of numbers into 2d array
 
Given an input file named grades.dat containing: 8 80 90 70 100 60 90 85 78 93 80 98 85 100 99 89 ...
[2 replies] Last: OP: you've just copied and pasted your homework, show some tangible ef... (by gunnerfunner)
intro to C++ need hw help
 
First of all hello to all. I am taking intro to c++ class and this homework problem has me confused on how to even go about writing my code since we haven't rea...
[3 replies] Last: Read all the number up to the '#' as the student ID token, and split t... (by Hengry)
A simple delay function:
 
I just wrote a function to pause the program for 'ms' milliseconds. However, I'm quite unfamiliar with this territory. Can I get someone experienced to comment ...
[1 reply] : You can use std::this_thread::sleep_for(). http://en.cppreference.com/... (by integralfx)
code is producing wrong sum of numbers. Cant find error
 
hi all my code is producing a sum of 19 when it is meant to be producing a sum of 14? Can anyone see where my error is? need a fresh pair of eyes been staring a...
[8 replies] Last: thank you! I will do that (by halleyc)
my assignment is throwing errors at me
 
we have an assignment which states that we have to write a program that prints customers bills. -the length and width of the room are expressed in meters and...
[6 replies] Last: need help mainly with the discount section and line 108. the program w... (by halleyc)
by Kalcor
Pointers
 
What is the purpose of pointer to pointer with double ** and just using 1 * and pointing it out to the address of the pointer, what i mean is: What's the use o...
[4 replies] Last: Ownership in the sense that the raw pointers can each, separately, cha... (by gunnerfunner)
FOR LOOP
 
The following code is supposed to calculate the sum of the numbers 2 through 5. That is, it should calculate the value of 2 + 3 + 4 + 5, which is 14. However, ...
[6 replies] Last: Oh i see, thank you for your help and time. (by daniel7)
Not Randomizing Numbers
 
My program is repeating the same set of "random" numbers... I'm doing this is Xcode. Please help. #include <iostream> #include <ctime> #include <cstdlib> #inc...
[3 replies] Last: Lol god bless y'all. Problem solved. (by jpgranier)
by Kalcor
Syntax problem
 
Hello, I was asked to submit a problem that does as following: Imagine that you have a twin brother or sister. Having another person that looks exactly like y...
[2 replies] Last: It's some challenge site yes, and here is what I've reached: #inclu... (by Kalcor)
advice and ideas would be appreciated
 
I am reasonably new to c++ and am currently using visual studio. I have got a school project for year 11, to make a console 'RPG game', and my plan is to imple...
[4 replies] Last: thank you very much newbieg! the first fight scene at the start is mea... (by OneShot)
by vgdd
RPG
 
I'm taking a video game design class and we are supposed to code an RPG , I'm having some trouble and I was wondering if someone had any sort of RPG code I coul...
[3 replies] Last: here is mine here vgdd, i am new too and have not completed it yet as ... (by OneShot)
Battleship Improvements
 
Hey guys, I'm supposed to make a sort of battleship version that is 1 player, that ends the game in as lowest moves as possible. So far, i have this as my code:...
[3 replies] Last: you have code to iterate over every square, right? now skip N rows an... (by jonnin)
Text Echo program
 
I have am program mostly written but I cant seem to get it to work so that the user can enter a filename and the program will echo the text from the specified ...
[2 replies] Last: #include <iostream> #include <fstream> #include <string> int main() ... (by JLBorges)
Just need help transfering this psuedocode to C++
 
// Pseudocode PLD Chapter 9 #2 pg. 421 // Start // Declarations // num dollars // output "Please enter the a whole dollar amount (no cents!). ...
[1 reply] : Gee, Mej you've been on this one for a year - pretty tiring I'll bet. ... (by closed account 48T7M4Gy)
a cast template
 
write a function: cast a container(such as a vector) to a tuple or Args&&... to a vector. or a tuple to a vector tuple size should be same with the v...
[2 replies] Last: Perhaps use std::common_type to determine the value_type of the vect... (by JLBorges)
by Yany
How to bind SQL Server large string length data type with CRecordset derived class ?
 
Hi, Can any expert help me? I'm using the MFC ODBC consumer wizard to create my CRecorset derived class to bind fields of my SQL Server table. But at run-tim...
[3 replies] Last: Wow!! so simple solution! void CMyClassRS ::DoFieldExchange(CFieldEx... (by Yany)
dumb 8 queens c++ code help
 
the assignment was to write a code for dumb 8 queens where you start with all the queens in the first row then test and move queens.i wrote the code but don't k...
[3 replies] Last: I have actually already written a solution for this problem, but in a ... (by goldenchicken)
Does not hold all list of input on Report
 
#include<iostream> #include<string> #include<fstream> using namespace std; void ReadFile(int property , int bedroom , double price , int &count) { ifst...
[no replies]
April 2017 Pages: 1... 111213141516
  Archived months: [mar2017] [may2017]

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