Beginners - October 2017 (Page 11)

container to hold objects of class type and it's derived types
 
And was trying to have a vector that could hold any object of class A or it's derived types using pointers. I tried to do: class A { }; class B : ...
[9 replies] Last: If the base class A is a polymorphic type, we can invoke virtual fun... (by JLBorges)
need help to complete this program please.
 
If someone can help me to write the program, would really appreciate thanks a lot in advance . Write a program to accept any number of grades. Then, print the ...
[1 reply] : The way this is worded it sounds like it is for some sort of class. Th... (by heintzman)
converting decimal to 16 bit binary
 
I am having some issues with this program. I will put the program below and my code. Change your binary conversion program to use the design using iteration...
[2 replies] Last: I have to set it up like this but for some reason the pow is not worki... (by mlass7886)
by beemo
Printing prime numbers
 
im trying to display prime numbers from 2 to 102 and print out the numbers from 2 to the entered prime number as practice but i dont know what im doing wrong he...
[1 reply] : You have an odd variation: usually the requirement is to display all p... (by Duthomhas)
Reading integers from file and displaying high and low numbers.
 
I need to have my program read each integer for a file called "integers.dat" and at the end, display the highest and lowest number. No matter what I change it s...
[4 replies] Last: Yeah I see what you're saying, I don't know why I did that. So if I g... (by closed account jhb7Djzh)
Question regarding header and implementation files.
 
I am a beginner, and I currently am trying to finish a project for a Computer Science class. I did research the archives and actually found someone asking a ...
[6 replies] Last: I figured it out myself. I had to name the formal parameters of the fu... (by Tellumendil)
by RNBW
Why is code ignored?
 
I do not understand why code is ignored (seems to be skipped over) in the area identified between lines highlighted with //*******************************...
[12 replies] Last: @Chervil I like it! I'll incorporate it in the code. I'm not sure abo... (by RNBW)
Help a noob out.
 
Hello, not long ago I started learning c++ (no programming experiance before that) I am starting off slow and I would like your help. This is my task: Clo...
[5 replies] Last: Is it possible to input your computers time and then add 1 second. If... (by sonar87)
Program that displays odd, even, and reversed digits
 
Hello, I'm currently trying to make a program that validates user input and displays the digits in the number as odd and even, and also displays the number rev...
[3 replies] Last: I'm currently trying to make a program that validates user input and ... (by Enoizat)
Lambda return type
 
Hi guys, Here, https://stackoverflow.com/questions/9620098/explicit-return-type-of-lambda I read that: However, if a lambda has one statement and that state...
[2 replies] Last: Here, https://stackoverflow.com/questions/9620098/explicit-return-typ... (by Enoizat)
this pointer
 
i expect the output to be the person's name and his pay. #include<iostream> #include<string.h> //for strcpy() using namespace std; class sales { ch...
[5 replies] Last: > Write a program to show the working of this pointer. Any program wh... (by JLBorges)
menu driven program
 
I'm trying to create a menu driven program using arrow operators and linked lists to track/update a list of movies. I think I already solved most of the code bu...
[1 reply] : Hello tadinaaawr, I believe you problem starts with lines 41 - 48. L... (by Handy Andy)
Statement problem in loop
 
I'm supposed to write a program that checks whenever the number the user inputs (m) exists in the array and outputs its position (a would be in "0"). If m is n...
[2 replies] Last: @repeater Thank you so much, I got my code worked :) (by jayiswho)
by Ch1156
How to use variables in other class members? (1,2)
 
So I decided to write a game and use classes to better strengthen my class knowledge, and it was going well, however I have one problem I cannot seem to figure ...
[34 replies] Last: ok thanks. What books would you recommend for OO design? (by Ch1156)
I bought Sams Teach yourself C++
 
Hello I'm new to this website. I love video games, and I hate working in warehouses. I want to learn how to program so I bought a book called Sams Teach yoursel...
[9 replies] Last: Alas, you have purchased a bad book. SAMS teach yourself books are gar... (by Duthomhas)
Solving Equations with Function Pointers Difficulty
 
Hey everyone! I'm trying to code a program that is designed to run an infinite for loop that finds the (x, y) coordinate at which two functions intersect. I've...
[1 reply] : You are making the problem twice as difficult as you need. Define a si... (by lastchance)
Problem with dynamic cast
 
Could someone explain what I'm doing wrong on line 38? I've spent about the last 30 minutes trying to figure out how dynamic_cast works and I just can't figure ...
[1 reply] : > what I'm doing wrong on line 38? Card is not a polymorphic type ... (by JLBorges)
HELP I am confused by this STl hw question I have.
 
I have never heard of a STL template. I tried going through the chapter again with no luck because I don't see how any of these could be answers. Since it has n...
[2 replies] Last: No, the answer is A. An “STL” template is any standard object tha... (by Duthomhas)
HELP for function in C++ hw question
 
Im pretty sure its a function call since the definition is the body and the prototype just tells the program what it is called and how to execute. But I am not ...
[1 reply] : yes it is a function call (by AndreGS)
i merged files using string but error in line 13
 
error: F:\c++projects\printmerge\printmergefiles.cpp|13|error: no matching function for call to 'std::basic_istream<char>::getline(std::string&, int, char)'| ...
[6 replies] Last: yaaaay it works perfectly now. #include<iostream> #include<fstream> ... (by closed account 1vf9z8AR)
October 2017 Pages: 1... 910111213... 33
  Archived months: [sep2017] [nov2017]

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