Beginners - June 2019 (Page 12)

by sparki
R-value references and move semantics
 
Hi, I require help in understanding what's the purpose of the program below and what it does. I can't seem to understand what it is trying to do. There are some...
[1 reply] : I assume you can figure out that it's calculating fibonacci numbers, s... (by dutch)
Crossroads city problem
 
Hey guys! I'm trying to find a solution to a crossing road problem i was given for practice. But i really hit a nail in it. Basically i am given a graph and...
[2 replies] Last: @Handy Andy Thank you for your reply. I wrote it really quick and did... (by FreeSocks)
by sturk
C++ template metaprogramming
 
Can anyone explain to me how does the following output of '5' came about? And how does this particular program works. Because I couldn't for the life of me figu...
[1 reply] : You can think of a template as instructions for the compiler to figure... (by Repeater)
how to count each letter in each word
 
hi guys im new in c++ and i dont know much the homework problem asks to count each word from the user input and then count the occurrence of each letter in the...
[14 replies] Last: #include <iostream> #include <string> #include <cctype> #include <map... (by lastchance)
how to print
 
hi guys im new in c++, and i don't know much. when i run the following code char input = {}; char name = {}; char age = {}; char title = {}; cout ...
[5 replies] Last: Hello gongong , No. "std::cin.ignore()" and "std::ws" may appear to ... (by Handy Andy)
by yup2
Subtracting two objects (overloading -)
 
Im having a bit of an issue subtracting two objects, the following code runs however it crashes after outputting the two objects. Ive ran into a wall at this po...
[2 replies] Last: Thank you so much for going in-depth!! I definitely understand it bett... (by yup2)
Initializing Array from a Class
 
Hello, I'm taking an introductory C++ class and I'm still a little confused by the act of separating classes and functions. I can't figure out why I can't in...
[4 replies] Last: Oh I see what I did wrong now-- thank you so much! (by StephBeni5)
almost done making a mini greeting code pls help.
 
i have made a conditional password lock statement program. it is as good as log in process and a greeting from the system . clude<iostream> #include...
[8 replies] Last: Thanks everyone (by coderking)
From arrays to vectors
 
I must be able to draw infinite number of circles, each must be draggable and droppable to a new location. When dropping it, redraw of the old circles on their ...
[6 replies] Last: :) Way on the other side. Only further east one can go from here is th... (by Niccolo)
How to build n bit with 1?
 
I want a function, which takes a int (not a compile time constant). Gives me back a uint64_t, which has so many 1 as the int parameter. Is that possible and...
[5 replies] Last: Oops! I forgot that. constexpr uint64_t repeat_one( int n ) { ret... (by Duthomhas)
guys i really need help i am not able make my code work
 
not working i used DEV C++ pls help with this code this is a SOS call pls help #include<iostream> #include<windows.h> #include<string.h> #incl...
[8 replies] Last: It seems that you are having troubles with nested conditional branches... (by fiji885)
just a doubt guys but pls answer.
 
i am actually unable to understand if it's possible or not, to have conditional statements where there are three or more possible answers . And if so can it be...
[12 replies] Last: Oh my God I am sorry Miss,pls don't take this for rude talk ma'am forg... (by coderking)
Understanding problem
 
(Perfect Numbers) An integer is said to be a perfect number if the sum of its divisors, including 1 (but not the number itself), is equal to the number. For e...
[13 replies] Last: When I wrote my version, I used std::optional : std::optional <std... (by Duthomhas)
by Bopaki
I cannot fiqure out what is wrong with this code
 
I get this error when I compile: error: reference to queue is ambiguous bool queue::empty(); #include <iostream> #include <queue> class queu...
[2 replies] Last: Thank you very much salem c!!! its all sorted out now (by Bopaki)
Which GNU g++ compiler
 
Hello Everyone I am a new beginner who would like to start learning C++. The problem for me is which GNU g++ compiler do i install? I am running Ubuntu MATE...
[7 replies] Last: Hello Duthomhas Big thanks for the Code::Blocks link, but i think i... (by PeterParis)
problem
 
hi im working on simon says. the game shows you a letter(For example: A)and you have to put that letter in order to continue pleying. the game also has 3 types ...
[3 replies] Last: Hello kingjames6, I have been trying to figure out your program all d... (by Handy Andy)
how do i write a function
 
hi, im new in c++, so i dont know much. how would i write the following into a function? 1. srand(time(0)); vector<int> vList; int size = vList.size(); ...
[6 replies] Last: thanks guys!!! all these things are super helpful!! my homework is now... (by gongong)
Generating random numbers
 
How to generate random number between 7 and 8? 9 and 10? 11 and 12?
[5 replies] Last: like that Like that is not between . [7, 8] and ]7, 8[ makes a ... (by MikeStgt)
Pls guys i need help with this irritating code
 
#include<iostream> #include<windows.h> #include<string.h> #include<stdio.h> using namespace std; int main() { char A ; cout...
[1 reply] : Don't make a new post for the same question: http://www.cplusplus.com... (by zapshe)
Reading in a file and then displaying the contents
 
Hello all. I've been a lurker here and have searched the forums for the answer to my question, and while I've seen several topics regarding the same question I ...
[3 replies] Last: well , you may check that the file does open an throw an exception st... (by ne555)
June 2019 Pages: 1... 10111213
  Archived months: [may2019] [jul2019]

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