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

Template deduction guide for std::array
 
In the template deduction guide for std::array: namespace std { template<typename T, typename... U> array(T, U...) -> array<enable_if_t<(is_...
[4 replies] Last: Thank you. (by TheToaster)
Floating point division in Stacks
 
This is a postfix evaluation program but the division is returning the int form of the answer instead of the float. #include <iostream> #include <cstdlib...
[4 replies] Last: Thanks a lot. I thought I wasn't understanding the syntax but it was j... (by ElleJay)
Book shop Program (1,2)
 
Hello, I have this assignment to do which is writing a program that will help a book shop owner to manage his store. Until now, I finished most of it but I face...
[21 replies] Last: You still still not reading from the file correctly. You have your i... (by fiji885)
DFS Algorithm consistently finds path with less vertices than maximum
 
I'm solving a programming problem with dfs. The tldr is as follows: There are n cows at coordinates x, y. They can communicate to others within their radius of ...
[2 replies] Last: @helios, my code gives 3 for the sample case above, and that is the ri... (by aceadams)
Read a single value from a file
 
Hi guys, I'm new to c++ programming and I'm having some issues about reading from a .txt file. I need to read only one value inside a file which is full of oth...
[4 replies] Last: i need the number which is on the third line and the second column R... (by George P)
Exam help. I have to solve a problem I have to solve and I do not how to
 
1st write a program that prompts the user to enter two integers and checks whether the first is divisible by the second.
[4 replies] Last: Thanks guy I was overthinking the problem greatly. It's just simple us... (by mollywhoppinRBG)
by mk7mew
Help asking user if they want to run the program again [HELP]
 
So I've ran this properly and everything seems to be set up correctly. However, I am still stumped on asking the user if they want to run the program again af...
[1 reply] : while(true) { // start asking how many judges for the compe... (by TheToaster)
by dbabo
Proper code design
 
Hello, i'm not sure how to properly architect the code in this situation. This is rtos type system, where i want to create a few objects that perform actions ...
[4 replies] Last: yes, it was clearly wrong. Thank you for pointing out. The code works... (by dbabo)
Review
 
#include <iostream> #include <ctime> #include <string> using namespace std; int main() { int num, guess; string firstName; bool isGuessed = false...
[1 reply] : Hi, The returns seem to work perfectly, I would just indent the code ... (by yup2)
quick question
 
Hi all, I just have a quick question. Is it ok to have two return 0; statements in your code? I can't seem to find a straightforward answer online, I am using i...
[4 replies] Last: Will it make a difference if i change return false; to break;? (by closed account 93v5LyTq)
guessing game loop help
 
i have been struggling with this project i have that is due later, we are supposed to create a guessing game where we prompt the user for their name, prompt the...
[10 replies] Last: Most often an example is the best way of explaining something most cle... (by TightCoderEx)
by dune
[SOLVED] How to Package the Final Product?
 
I searched here before asking this to the Forum, and I found a few answers. I tried as they instructed, but my result was a flop. IDE: Code::Blocks-20.04 wx...
[2 replies] Last: Inno Setup is nice. I'm on YouTube, now, watching how to use it. Tha... (by dune)
graph algorithm
 
G is a directed graph. There may be some cycles in G. There may be some seperate sub-graph in G Now, make k(>=1) steps in step i, select si v...
[6 replies] Last: if you can solve it, help me. You just need to give me some documents,... (by Wu zhen hai)
by Ovid
How to make the character size square
 
Hi, Is that possible to make the character width and height even? I'm trying to draw a character by text. Thanks
[3 replies] Last: Thank all of you for your help : ) (by Ovid)
Finding the largest number in a file.
 
Alright, so my goal here is to find the largest number in a file and output it to another file. My program asks the user to enter the name of the output file. N...
[4 replies] Last: #include <iostream> #include <fstream> #include <sstream> #include <i... (by lastchance)
Replace any space ' ' by '_' in 2-character string passCode. Sample output for the given program:
 
I'm stuck on a problem in Zybooks, the goal is to take a 2-character string input and replace any white space with an underscore. I'm pretty sure I'm on the rig...
[19 replies] Last: iterating through a sequence of characters using an index is out of d... (by mbozzi)
game emtities container
 
I need help implementing an efficient container class to hold my game entities, I did create a double linked list but when compared to the stl vector class, it ...
[5 replies] Last: First, why do you repopulate the map each frame? Surely you don't rete... (by helios)
Installing a later compiler for Dev C++
 
Hi, I believe those that followed my previous questions knows that I'm using Dev C++ as my IDE and the default compiler that comes with it, TDM GCC 4.9.2. Howev...
[12 replies] Last: There will be "teething" problems as you learn how to beat into submis... (by George P)
by rgd
Conversion of C++ based legacy program
 
Hi, I have recently become very frustrated with software that has not installed properly that I need for work purposes (I use Linux for this work). So I am ...
[3 replies] Last: Modernizing legacy C++ code is not for the faint of heart, or someone ... (by George P)
glUseProgram
 
I don't know why glUseProgram(0) prevents rendering operations here while (!done) { // ... glUseProgram(myProgram); renderer->DrawEntities(); ...
[2 replies] Last: I somehow managed to fix the error by rewriting the entire shader clas... (by fewdiefie)
April 2020 Pages: 1... 34567... 10
  Archived months: [mar2020] [may2020]

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