General C++ Programming - April 2020 (Page 2)

Cannot Use std::bind
 
I have a class called SoundThreadManager. It defines a function: void Init(f_GetSoundSample getSoundSample, f_SoundConverted playSound, int sampleRate,...
[6 replies] Last: Thanks for you help. This is a great forum, for noobs like me to ask q... (by Manannan)
Pulling info from a file and creating an object
 
Hello I am pretty new in regards to fstream and file manipulation. So I have a hw problem where I am reading a file with a list of <first name> <M or F> <freque...
[11 replies] Last: You may wish to further re-factor the design and implementation of thi... (by jwin)
How to take input as fractional number without using float/double data type?
 
Is it possible to take a decimal number as input from the user without using float/double data type? And this number has to be used further for calculation. I...
[5 replies] Last: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.178.3957&rep=... (by lastchance)
by mk7mew
Homework [Help]
 
I'm still not understanding how to fix the c++ code that was asked by my prof. She asked us to complete the entry shown below to add a function to get the stu...
[1 reply] : Also here https://www.cplusplus.com/forum/beginner/269978/ Don't post ... (by salem c)
passing arrays as function
 
Instructions Note: Some data input to this program and some program output depends on your name. If you do not use your name as required, points will be deduct...
[3 replies] Last: you can pass an array to a function as a pointer or you can use hard c... (by jonnin)
How to display two decimals places in the final result
 
This is my first time posting on this website so bare with me How do I make the final result display two decimal places? (since I am working with money. #...
[1 reply] : The compiler isn't reading from a file, your program is.* while ... (by Ganado)
by Esso
Where can I find a program / ide do that?
 
https://www.cs.usfca.edu/~galles/visualization/RecFact.html It would really help!
[8 replies] Last: Yeah, dhayden ... I guess you're right, thanks, bro! :) (by Esso)
function call help using while loop for validation
 
I am trying to use a validation block by via a function because it will be repeated. When I just use the while loop it works but I know I should be able to do a...
[15 replies] Last: So the while function that's in the first if statement is the only on... (by mollywhoppinRBG)
by TOGS
Ignoring characters within a string
 
I have a string in this format:"sonic",2019,"PG-13","Action",113,0 within a textfile, i've been able to use a stringstream to parse each individual value t...
[4 replies] Last: trying to make sure it prints out in the exact same format as text fi... (by George P)
by thmm
Why was/is Bitcoin written in C++ instead of C?
 
I don't know what Bitcoin required but generally speaking C++ has lots of features C doesn't. Why should anyone use C when starting a project from scratch?
[2 replies] Last: Reddit copy-paste. You know what that probably means... https://bitcoi... (by Ganado)
How to write if statements in templates
 
So I have this code: template<typename T, bool = std::is_arithmetic_v<T>> class Expression; template <typename T> class Expression<T, false> { }; template ...
[1 reply] : I'm not entirely sure what you're looking for, but maybe something lik... (by dutch)
Minimum number funtion
 
Good day, i am a first year student in Computer Programming. I have been tasked with writing a program that prompts a high school student for personal details a...
[5 replies] Last: Thank you so much, using "do" loops instead of "while" loops did the t... (by Naledi1)
static variable cannot be accessed directly from a code in class
 
Why a static variable as a class' member cannot be accessed directly from a line of code of a function inside class, instead it has to be access in the function...
[2 replies] Last: The question is a bit unclear. I think Repeater's answer is what abdul... (by Ganado)
by Hanske
Boost serialization (1,2,3,4)
 
I would like to save objects from a parent class in a text file and then be able to load the objects. The problem is that all the objects are pointers so only t...
[63 replies] Last: Hey everyone, I'm getting the error "std::bad_alloc" when running the ... (by Hanske)
by kyviro
throw_bad_alloc error with arrays
 
Salutations. I am new here, but I have seen that people here are quick to reply. I have a problem when I'm handling some arrays in my program. I have an ar...
[5 replies] Last: Thank you very much for the reply! I have replaced the <= operater wi... (by jlb)
Error In Conversion C++ Code To C
 
[// C++ Implementation to find the 02 // XOR of the two Binary Strings 03 04 #include<bits/stdc++.h> 05 using namespace std; 06 07 // Function to find ...
[5 replies] Last: > Error In Conversion C++ Code To C Also know as I found this code in... (by salem c)
by kbw
Application of C++ in ARM processors
 
I can't see how using an ARM is different than using some other processor from a C++ programming point of view. The arm32 toolstack has a few quirks, but from ...
[4 replies] Last: I can't see how using an ARM is different than using some other proce... (by dhayden)
Common function which accepts different structures as parameter
 
New to c++ and i am trying to write a common function which accepts a structure with common fields. For example struct A { int id, int p_id, json_t...
[2 replies] Last: With function overloading: void f(const A& s); void f(const B& s); vo... (by thmm)
How to clear/empty priority_queue of objects
 
Ok. I'm a beginner and missed that fact that I was missing the open and closed parentheses next to "pop". It's a method. Duh!!! Thanks for reading. I wou...
[1 reply] : Is pop a function? Then call it like you would call another function. ... (by Ganado)
Hangman Program Problem
 
Most of my hangman program works fine, except for when I get to the //Guessing Letters Section at the bottom. The only letter from the word it accepts for is th...
[7 replies] Last: I believe the problem to be in here: for (guesses = 0; guesses < max... (by Sion Tiplady)
April 2020 Pages: 1234... 10
  Archived months: [mar2020] [may2020]

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