General C++ Programming - April 2019 (Page 4)

GALTON BOX
 
Can you help me finish the Galton Box program? Here is what I have so far: #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int m...
[6 replies] Last: drops must equal slots minus 1. (by YeetParadox)
simple encryption program problem
 
Hey guys, I am doing research/ a project on cryptography and how attacks on ciphers work, so I made a simple program to encrypt and decrypt a message, it is ...
[6 replies] Last: its a LOT easier if the hacker can send his own plaintext message and ... (by jonnin)
Selection sort a linked list
 
Hello, I am trying to programm a linked list with some extra methods, which are "sum", which adds up all the numbers in the linked list(isEmpty is implemented)....
[5 replies] Last: I did nothing but muse at you (literally inspired you to get to work),... (by jonnin)
Roulette Color Streak Program (1,2)
 
Hi all - Brief history - long time back I wrote a VB program to simulate spinning a roulette wheel and was curious what the longest streak of any particular c...
[38 replies] Last: if the PRNG uses a 3 bit seed then it's likely to have a cycle afte... (by MikeStgt)
by Fadey
inheriting referencer/data class as template, should I optimize getData()?
 
Sometimes coming up with a good title for topic seems harder than the problem itself in the topic. I have: template<class T, class dataType> class someContai...
[5 replies] Last: is this even remotely useful... class 1 creates the thing via a point... (by jonnin)
Copy Control and BST
 
I've just started the Copy Control chapter in C++ Primer (5th Edition) and stumbled upon a vague exercise, which is as follows: Given the following classes, i...
[2 replies] Last: I guess that clears things up. Is the below implementation/design some... (by closed account ywbpSL3A)
need hlp
 
Write a program which accepts an account balance and computes any service charge. Balance Service Charge < $300 ...
[2 replies] Last: Aside from the rubbish titles and lack of effort, we have multi-postin... (by salem c)
Problem with SDL | Can't install/prepare it
 
Hello, I have a problem with compiling my SDL code in Dev-Cpp I did all the instructions from http://lazyfoo.net/SDL_tutorials/lesson01/windows/devcpp/index.php...
[6 replies] Last: You, uh, should be installing SDL 2 , not working with the old SDL. h... (by Duthomhas)
Direct vs Copy initialisation with explicit copy constructor. Why we get the following error ?
 
class K { public: int x_; explicit K(int x) : x_{x} {} explicit K(const K& k) : x_{k.x_} {} // No error is seen if this is made }; ...
[1 reply] : See Notes under https://en.cppreference.com/w/cpp/language/copy_initia... (by JLBorges)
How To Interpret std::map Partnered with glm::ivec3 and Struct?
 
Hello Professionals, Good day. I came across this programming troubleshooting problem wherein I am trying to print the value of the key of a certain std::map...
[4 replies] Last: Thank you very much for all your help about the g_polCoeff. I found th... (by kindgnice)
function call not recognized as constexpr unless function definition is in same translation unit
 
Hi, I have this definition in file a.cpp: constexpr long fibonacci(long n) { return n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2); } and I...
[2 replies] Last: Thanks Peter87! (by JUAN DENT)
by elsa
Can't create two different queues using one template queue
 
I get an error on stringQueue.enqueue(name) and stringQueue.dequeue(name) underneath "name". The error I get is "cannot convert argument 1 from string to in...
[2 replies] Last: That fixed it, ne555. Thank you. (by elsa)
Opertor = is not working
 
struct PID{ PID operator= (PID &rhs)const { PID lhs ; lhs.processId = rhs.processId; std::cout<<"rhs process id is : " << lhs....
[3 replies] Last: if(rhs.Childs.size() != 0 ){ for(int k=0; k< size... (by ne555)
by ksolo7
Having trouble pulling boundary data points from input file
 
I have an input file that consists of data in the form "Celsius,Resistance", for example one point is "9,10440" which stands for a temperature of 9 degrees Cels...
[5 replies] Last: This has been continued in another thread (wish this didn't happen!): ... (by lastchance)
Visual Studio Executable (1,2)
 
Is it possible to run a program without needing extra files? For example, if I have a 3d game that has 3d models, and those models are stored in .obj files. ...
[20 replies] Last: I think there is a lot of missing the point going on here. There is n... (by Duthomhas)
by Ojies
Input loop isn't working properly
 
There is a loop from lines 750-970 that has 2 options in an if statement for when you input a string for the variable "input". When it asks you to input somethi...
[2 replies] Last: There is a loop from lines 750-970 that has 2 options in an if statem... (by doug4)
My last name won't display
 
The code is suppose to gather phone numbers using structures. I don't know what to do because the string won't output a last name. Example: Use 1 student then ...
[3 replies] Last: use code tags Little subject drift, what is described it http://www.... (by MikeStgt)
Client/Server File Send - Losing Data
 
I am having a few issues with a file transfer over a network. I am losing data at the end of each file that I send. Here is my code: Client: #include <stdaf...
[2 replies] Last: Thank you soooo much for your reply... i will try and get this to work... (by Googie85)
Alphabetic Order Algorithm
 
Hi guys...(I can start this topic with :"Sorry for my english") I'm having few problems with my code, to say the truth I don't know what is the problem... but...
[4 replies] Last: thanks a lot, now i don't have time, it's morning and i have to go sch... (by ChrisPy)
I need help with this structures program
 
I am writing a program to display two student's grades and if they are a OK GOOD or EXCELENT student, and for some reason when it won't let me enter the p2 pers...
[4 replies] Last: In addition, you do not need for every person its own function. To do ... (by MikeStgt)
April 2019 Pages: 123456... 9
  Archived months: [mar2019] [may2019]

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