General C++ Programming - July 2018 (Page 2)

Unexpected Output with While loop
 
I am in a C++ class and when compiling a solution to an assignment, the expected outcome is 814 wolves, however, I only get 806. The code is a simulation betwee...
[8 replies] Last: @homy18 -- your output is technically off by a day. You're incrementi... (by icy1)
by ysf007
How resolve selection enigma code ?
 
Hi, great community I'm on my way to learn c++, and thing are getting harder, that's why I need your help I need to process some file that has this format (ID...
[15 replies] Last: I noticed that the following line is not the most occurred 4144 La... (by ysf007)
by darkX
player can remove 1 or X or Y coins from the tower
 
A and B are playing a new game today . They form a tower of N coins and make a move in alternate turns . B being the God plays first . In one move player can re...
[4 replies] Last: Oh, do we assume the players are perfectly rational and don't make mis... (by Repeater)
Reference to another article or thread Fixed Errrors
 
I found that this method I used I found that this is how I did this If this is any help to you great. I fixed some errors that it had in c++ Original Thread fo...
[2 replies] Last: A modern way would be: #include <iostream> #include <vector> #includ... (by Thomas1965)
by ctuser
Issue flipping the case of letters
 
Hi! I am having trouble with the flipped function of my code. I want it to display the opposite of whatever was given by the user(in terms of upper and lowercas...
[5 replies] Last: You need to copy first, I think. #include <iostream> #include <cstri... (by lastchance)
by stav
Perfect forwarding
 
Hi My question is why does the following code always end up invoking the copy constructor of MyClass ? #include <iostream> class MyClass { public: MyC...
[2 replies] Last: Type and value category are independent. Your function parameter (whe... (by mbozzi)
Start other program and send receive data to it
 
I have an automated GPU test I am making with Unreal Engine, and I want to use it as a part of multitude of computer tests (also in the making) to click start a...
[3 replies] Last: Probably the most portable solution is to use a socket, then. The code... (by helios)
by grjmmr
How do you know if you have the right library?
 
Working on an led project. Calls out for ethernet.h, artnet.h and fastled.h. I have confirmed that the ethernet and fastled libraries are working by running a s...
[1 reply] : It seems that you've done a good job of narrowing down the problem. D... (by dhayden)
by stav
Move constructor not called?
 
Hi I've been trying to learn about move semantics and i thought i finally had a pretty good grasp of it....but nope. I wrote this program expecting that it wou...
[2 replies] Last: You will get a call to MyClass::MyClass(MyClass &&) if you change the ... (by helios)
one time pad encryption
 
hi guys, I am studying for a cryptography exam, not a particular programming question but it will relate as we will soon have to implement a one time pa...
[9 replies] Last: xor is your friend. its easy to prove that its self reversing, and it... (by jonnin)
User friendly program
 
I was given an assignment where I had to change a program to make it user friendly. I just want a couple of pointers on how to make user friendly programs. Any ...
[4 replies] Last: Thank you both for the pointers. It really helped,and I believe I have... (by manchester389)
Insert unordered_map into a vector
 
I need a vector in which i want to insert std::unordered_map. let, std::unordered_map<int,boost::gregorian::date>un_map; std::vector<std::unordered_map<in...
[2 replies] Last: Do you want to insert the whole map into the vector or only the values... (by Thomas1965)
Class Representation In Assembly
 
Hi, I am researching how c++ classes represented in the assembly. But articles I found for people who know assembly well. But I don't :( Can someone explain how...
[3 replies] Last: @kohlrak thank you :) (by closed account DEhqDjzh)
How to Chage & operator
 
hi, The & operator returns the address of the variable. What I want to do is change & operator to something like _ or é or $ (You got the point). How can I do ...
[5 replies] Last: @mbozzi Hi, Its just curiosity I wanted to create a custom operator (by closed account DEhqDjzh)
Read of address 00000444
 
Hi guys, I am working on a project (abc) and encountered with an error "Access violation at address 00435C27 in module 'abc.exe'. Read of address 00000444". ...
[11 replies] Last: Thanks Jonnin and Helios for your responses. @Helios: Actually you ga... (by AshishMishra)
Help with Programming
 
Hi, how do i do this part of program? I need my program to say this (below) however I am unsure as to how to do it. My code is written below I was hoping som...
[4 replies] Last: I need my program to say this (below) I don't see anything. Say wh... (by Repeater)
by Xydez
Can't put float* in std::vector<float[]>
 
Hello! I have this line that declares a float* to an array. float* vertex = new float[vec.size()]; And I put some variables in it within a for loop ...
[1 reply] : vector<float*> vector_of_float_pointers; float* vertex = new float ;... (by Repeater)
by dorlow
Bjarne Page 79 Need help understanding example
 
I have the Bjarne Stroustrup Programming Principles and Practice Using C++ 2nd edition. I am on page 79. 3.9.1 has an example... char c = 'x'; int i1=c; ...
[3 replies] Last: i1 and i2 are just variable names. There is nothing funky going on wi... (by gaxio)
by Fadey
Exporting objects from exe and importing them on DLL. Is it normal?
 
Hello everyone! I discovered it to be unusual and found very little information about on the internet. On visual studio, when we export an object __dec...
[4 replies] Last: One reason to put things in libraries instead of a monolithic executab... (by jonnin)
Mathematical Equation
 
Problem Statement: Prakhar is fond of solving the mathematical equations,one day his girlfriend asked him a new equation to solve.Equation is as follows: K*(K...
[10 replies] Last: you probably can, actually. 10^9 for a 4-byte int is what, 4-5 gigs? ... (by jonnin)
July 2018 Pages: 1234... 9
  Archived months: [jun2018] [aug2018]

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