Beginners - August 2019 (Page 6)

Errors when explicitly deleting move assignment operators
Today I came across this code: #include <string> #include <vector> #include <iostream> struct my_type { my_type(std::string name_) ...
Aug 9, 2019 at 7:36pm
[5 replies] Last: @TheToaster, despite the name "std::move", the function doesn't perfor... (by Niccolo)
Binary shift is "too big" but isn’t
I’m making a floating_point class and am trying to access the last bit in an unsigned long by masking it by (1 << 64) , but when I compile and run it stops...
Aug 9, 2019 at 1:28pm
[7 replies] Last: Note that numeric_limits<>::digits is the number of non-sign bits in a... (by dhayden)
is there any java part of this forum??????
SOS SOS
Aug 8, 2019 at 3:19pm
[1 reply] : No. This is a C++ (and sometimes C) forum pretty exclusively. -Albatr... (by Albatross)
Question about r-value reference with function call
I saw the sample code on Stack Overflow. (https://stackoverflow.com/questions/3582001/advantages-of-using-forward) void overloaded_function(const std::st...
Aug 8, 2019 at 2:45pm
[2 replies] Last: > every functions' return value is treated as r-value. Is it correct? ... (by JLBorges)
by Ch1156
Pointers vs references for class objects (1,2,3,4)
So in a class using virtual, I see some examples use pointers like so: Weapon *w = new Weapon; Bomb *b = new Bomb; Gun *g = new Gun; w->loadF...
Aug 8, 2019 at 2:22pm
[62 replies] Last: I was just wondering if that was the best way to do it, it seems like ... (by Ch1156)
help with search
Hi everybody, I want to print out the qualified items in a vector if a user decides to search for it. Please tell me how to do that?
Aug 8, 2019 at 4:51am
[2 replies] Last: #include <vector> #include <algorithm> #include <iostream> using name... (by anup30)
string and file
Hi! I'm trying to read lines from a text file. The file is like: name1 surname1 number number_1 number_2 .. number_n name2 surname 2 number .. I have to prin...
Aug 7, 2019 at 10:13pm
[6 replies] Last: LearnCpp's tutorial page on std::stringstream : https://www.learncpp... (by deleted account xyzzy)
by RicoJ
Making my own iterator: how to convert a non-const iterator to a const-iterator?
Hi all, I am trying to implement a custom container and I need to make an iterator for it. I want to squish const iterator and non-const iterator in one clas...
Aug 7, 2019 at 3:19am
[1 reply] : > I want to squish const iterator and non-const iterator in one class... (by JLBorges)
Shuffle Algorithm for my Poker application
I am in doing a school-related project which requires that I incorporate various elements of what we have learned in class, into my project, which is a simple g...
Aug 7, 2019 at 2:19am
[12 replies] Last: It sucks being a noob at c++. Some of us still are. Self-taught and... (by deleted account xyzzy)
vector of unique_ptr
I tried to make a vector of unique_ptrs, but here I get a compiler error when I try to dereference the ptr: #include <iostream> #include <memory> #inclu...
Aug 6, 2019 at 8:50pm
[3 replies] Last: Also a quick tip. When making a unique_ptr, you can also use the std::... (by KishoreG)
Tic Tac Toe AI
The program just crashes after a couple of go's and i can't figure out why # include <iostream> #include<random> #include <ctime> using namespace std; c...
Aug 6, 2019 at 7:32pm
[4 replies] Last: You have a lot of code that is nearly identical. That's always a good ... (by dhayden)
Debugging in Visual C++
I am having a hard time debugging in Visual C++. Most of the time, the element I want to watch is optimized away. I see something happening, but I am unable to ...
Aug 6, 2019 at 6:48pm
[5 replies] Last: Debug code is often a hefty multiplier slower than release code so d... (by Repeater)
Rectangle Sum with array2D
I've been giving this code several tries but it keeps crashing. Input 2 integers n,m, and the next n row input m integers each row (in other words, input a 2d...
Aug 6, 2019 at 6:45pm
[5 replies] Last: Pardon me for piling on here, but I'm going to expand on @jonnin's and... (by Niccolo)
Program Is Outputting Data as an int not double?
I made a program that converts money from yen, kroner, and/or pounds to USD. However, for some reason it outputs the result as an int rather than double for kro...
Aug 6, 2019 at 6:30pm
[5 replies] Last: Here are some examples of output: Input the balance of money you woul... (by PiggiesGoSqueal)
This has been asked before by others....
But it seems I can't apply the solutions given to them for some odd reason. My issue is the age old VS2015 Error C2512: "No appropriate default constructor a...
Aug 6, 2019 at 4:57pm
[19 replies] Last: "Problem Solved." Then please tick the box so the thread is green che... (by deleted account xyzzy)
Digit Extraction
Can someone help with my digit extraction our Teacher ask us to do like this, WRITE A PRGORAM THAT INPUT 1ST NUMBER AND DISPLAY THE ONES,TENS,HUNDREDS,THOUSAND...
Aug 6, 2019 at 2:15pm
[11 replies] Last: Thank you Sir, @lastchance, i finally submitted to my teacher. (by philipmorries3)
If/Then Statement Issues?
I picked up C++ as a beginning programming language after moving on from Scratch a couple of years ago. I've been working on my current project for a little whi...
Aug 6, 2019 at 1:27pm
[6 replies] Last: Do not listen to spam poster, its random text. (by jonnin)
Why does this code not need a move-ctor?
My textbook is giving an example of a generic class to store generic objects for a game board without using templates. Here is the abbreviated pseudocode: c...
Aug 5, 2019 at 11:00pm
[1 reply] : the move-constructor does what the author wants (move the vector) the ... (by ne555)
by Ryan15
Counting vowels and storing non-vowels into array
I would like to store any non-vowels in notvowel and display them but I'm not sure how to do it. #include <iostream> using namespace std; int mai...
Aug 5, 2019 at 6:57pm
[2 replies] Last: Here is an implementation using a different function with C++17, just ... (by KishoreG)
First letter in string output not showing
Hi, i made a simple oop program in which i ask user to input some values and then print them. The problem is, the first letter of the first string is not showin...
Aug 5, 2019 at 6:21pm
[5 replies] Last: Thank you so much Andy, yes putting cin.ignore() after cin>>bookprice ... (by zeplika)
August 2019 Pages: 1... 45678
  Archived months: [jul2019] [sep2019]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.