Beginners - April 2019 (Page 15)

by sturk
C++ Polymorphism
 
Why is the output 'B' instead of 'BD'. Do not get it.. Given the following code: class B { p...
[2 replies] Last: pB points to an object of type B so that is why pB->foo() will call B:... (by Peter87)
by arg57
Why use std::
 
Why do some people use std:: when you can use "using namespace std " ? ng Put the code you n...
[2 replies] Last: the 10 cent summary of the article is that std:: is huge beyond contro... (by jonnin)
Making the player go back to the same question
 
Hello, im trying to learn how to programm and im trying to make a little test now as my first projec...
[1 reply] : #include <iostream> int main() { const int correct_answer = 4 ; ... (by JLBorges)
Storing vectors in vectors?
 
So I'm new to coding and I'm having difficulty with this homework. Basically the hw is an athletic d...
[5 replies] Last: it does not work that way. push_back puts an entire item of the <type... (by jonnin)
allow the user to skip entering one of the values
 
can someone give me an example of a code that will still run if the user don't input a data? like fo...
[2 replies] Last: #include <iostream> int main() { int first = 10 ; // 10 is the d... (by JLBorges)
by kenken
Primality test
 
This function seems to work for small number but fails with large number. Can anyone help me underst...
[6 replies] Last: Its part of the language and has been for some time (c-99 era? not sur... (by jonnin)
Python to CPP
 
I have a code snippet of tree in python but I can't change it to C++ so I need help here def ...
[7 replies] Last: thanks i got it! but the max_profit() function which @helios converte... (by closed account STD8C542)
Need an approach
 
You are given a rooted tree with N nodes (numbered 1 through N); node 1 is the root. For each valid ...
[8 replies] Last: It seem to question from an on going contest https://www.codechef.com/... (by gokuluffy)
by m2020
operator precedence and pointer to an array
 
Hello everyone I have very basic questions 1- why the output of following code is 4? (in many ...
[5 replies] Last: Thank you dear duthomhas. (by m2020)
Return type of std::map::insert
 
At the time I try to understand the behavior of the std::map facilities. Especially I want to know o...
[3 replies] Last: If you don't care if the key already exist or just want to overwrite o... (by Peter87)
by sturk
C++ multiple inheritances
 
Why is the answer 1 and not 2 to the following codes below? Revising for a test. Thanks! Given...
[1 reply] : ab.A::print(3.14f); This line specifically states that the print ... (by Repeater)
struct in c program
 
Bellow code is c programing. struct NodeStruct { int Base; int Value; void (*pinMo...
[2 replies] Last: Thanks Duthomhas (by kakaducsy)
Reading input from file into vector
 
Hello, I was reading in Bjarne Stroustrup's "Principle and Practice Using C++" when I encountered t...
[5 replies] Last: Zeta z; … anytype z; // redefinition of z vs for (…) { ... (by Duthomhas)
Getline Repeats cout command twice, Help please!
 
I'm trying to make a program that's just an general assistant. It works great. Just one glitch. When...
[2 replies] Last: Hello navilgameboy, PLEASE ALWAYS USE CODE TAGS (the <> formatting ... (by Handy Andy)
Inventory/List
 
I am wondering what would be the best way to create an inventory class or list, to store and possibl...
[1 reply] : I would be inclined to use either a std::set or a std::map. Use a std... (by Duthomhas)
Getline Repeats cout command twice, Help please!
 
I'm trying to make a program that's just an general assistant. It works great. Just one glitch. When...
[4 replies] Last: Yay. (by Duthomhas)
interactive program, sumone plz solve it
 
Write an interactive program that asks the user for the population of a country,and replies with how...
[4 replies] Last: Try solving this in 3 steps. First write a program that prompts for t... (by dhayden)
"Segmentation fault (core dumped)" While Using Recursion
 
Please Note: This is a homework assignment, however , the due date has already passed and I'm jus...
[6 replies] Last: [quote=jonnin] Nevermind :) I havent worked in octal in a while, and m... (by PiggiesGoSqueal)
by AlanW1
Homework Help Please - C++
 
In the new intellectual TV show, the participant passing to the super final is offered the following...
[8 replies] Last: dhayden, I will try to do it yourself according to your recommendation... (by AlanW1)
April 2019 Pages: 1... 1314151617... 24
  Archived months: [mar2019] [may2019]

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