General C++ Programming - October 2019 (Page 2)

STDIN,STOUT,STDERR
 
Hey guys, So something I have been using for quite a while but I don't really know the nuances of what is really happening, so STDIN or standard input is ...
[9 replies] Last: Second, it appears you are confusing classes and objects. And STDIN,... (by jlb)
Structures Problem
 
I need help with the following question: Design a structure Student containing the following members: 1) First Name; 2) Last name; 3) Date of birth (it shou...
[1 reply] : Your 'Student' array lives in main(), so create and populate your arra... (by Computergeek01)
inheritance and pointers
 
I've written 2 classes that inherit from another class, and written a class that has an array of pointers of the same type as the parent class. in the array of ...
[1 reply] : Instead of *(animal + i) you can simply write animal . It's an arr... (by coder777)
Guaranteeing the variable is correctly initialized dynamically
 
How do we check/guarantee the variable is dynamically initialized correctly in runtime before its first requiring operation on C++?
[1 reply] : That's what a constructor is for. (by kbw)
Buffering
 
Hey guys, so 2nd question of the day and sticking to the common theme of I/O, why does cout and cin use output and input buffers? so I understand the bene...
[2 replies] Last: True FurryGuy, I always do research and look for the answer before pos... (by adam2016)
Refactor by removing nested for loop
 
This simulation is given finding the minimum numbers of patrollers, given patroller's coverage and position of the weak points. The weak points are the weak poi...
[1 reply] : Not exactly sure what the code is supposed to do. Some additional com... (by doug4)
Loops and Grades Chapter 7 stretch C++ HELP PLEASE
 
In this problem, you will be prompting a student for grades and credits for courses taken. From that, you will calculate a GPA. This site: http://www.back2co...
[2 replies] Last: please use code tags and put your question at the top, not hidden in c... (by jonnin)
Memory Access Error - What to do?
 
Hey there :) I am trying to write a programm finding vectorial (3 component) zeros of the Pfaffian determinant of a given matrix. I analytically found an expr...
[2 replies] Last: just about every line of that code is hitting an array with an index. ... (by jonnin)
Best practice for creational design patterns in C++
 
Dear experts, I wonder if there is some best practices to generate objects which has complexity (c.f. many variables dependent on subclass, it needs a lot of...
[1 reply] : You could start by looking at "design patterns". (by kbw)
by joshp
Coin Flip (heads and tails display)
 
Hi, for my assignment I'm trying to output the users requested coin toss amount and then give them the amount of times they flipped heads and tails. I'm having ...
[1 reply] : You need to count home many heads and how many tails you get. You hav... (by kbw)
Design for functional programming in C++
 
Dear experts, In C++11, std::function & std::bind were introduced, which open the door to make use of functional programming techniques in C++. Their powe...
[1 reply] : You could take a look at Ivan Čukić's book, Functional Programming i... (by kbw)
dice game
 
Write a C++ program to implement a three-player dice game with the following rules: 1. Begin with Player A and roll two dice: dice d1 and dice d2. 2. If the s...
[6 replies] Last: you are misreading it, or, winner may be poorly described or flat out ... (by jonnin)
object self-destruction
 
hi everyone, i´m asking myself if it is allowed to let an object self-destruct. take a look at this example: struct Item; struct MyContainer { vector<...
[5 replies] Last: (either a reference or a pointer) Pointer. Named this . It's actua... (by Repeater)
Change to numbers
 
One day, Jojo wants to send a secret message to his friend. Jojo has a sentence consists of alphabet and whitespace characters. Jojo wants to change all the alp...
[6 replies] Last: we do not mind to help C (esp simple questions), but we get a lot of p... (by jonnin)
can anyone do this for me as im a beginner
 
Create a Class named GradeMethod, which consists of the following functions: string Marks(int marks) to Input marks and return grade wrt marks according to t...
[3 replies] Last: why is there no c+ and what does the moron who scores a 50 because he ... (by jonnin)
Boost::Serialization Help
 
Hi! I'm using Boost Serialization (https://www.boost.org/doc/libs/1_71_0/libs/serialization/doc/index.html) and I had a question about serializing classes th...
[3 replies] Last: For posterity, It's worth noting that I think I figured it out. Boosts... (by Aaron Vienneau)
Error when I try to call the display function. The comment about it is toward the end of the program.
 
/* Lab Lesson 7 Part 1/2 Write a program for the hypothetical Acme Wholesale Copper Wire Company. This company sells spools of copper wiring for $104 each...
[3 replies] Last: Your display function is contracted to have 8 parameters passed, not 5... (by George P)
Error in linked list template class
 
class Node { public: Node(); void insertnode(int data); void deletenode(int index); void printnode(); void sortnode(); Node<t>* ...
[3 replies] Last: I never used the keyword "using" except for using namespace std; htt... (by George P)
Tool to analyse, parse then build a rough draft or fine diagram of functions' interrelation
 
Is there a program or software to analyse, parse then build a rough scheme/draft or fine diagram of functions' interdependencies with their interrelationship fr...
[3 replies] Last: You could look at Doxygen http://www.doxygen.nl/ Profiler, like gprof... (by keskiverto)
Grading papers
 
Hello I have a new question: I just started a 2nd level C++ class and we have an assignment. Grading quizzes:Write a program helps your instructor grade quizzes...
[9 replies] Last: does it calculate and present the quiz grade? The code doesn't do mu... (by zapshe)
October 2019 Pages: 1234... 10
  Archived months: [sep2019] [nov2019]

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