Beginners - April 2020 (Page 17)

My calculations aren't calculating
 
This is the prescribed question. Write a program that will repeatedly ask the user to enter the dimensions of a can and then calculate and display the total su...
[12 replies] Last: Hello dumdumFlame, "<cctype>" is the header file for the functions "s... (by Handy Andy)
by DyFxvt
How do I create a window that constantly updates?
 
I have been trying to learn how to create a window in a program, but every time I try some code, the screen only updates when I move my mouse. Why does this hap...
[6 replies] Last: When I added that to my library I got an error: ||=== Build: Debug in ... (by DyFxvt)
QuickSelect returning random value
 
I am trying to implement a quickSelect algorithm from my textbook. When I set breakpoints and I check all my return parameters, it shows the correct value that ...
[5 replies] Last: @jonnin So is the way I am going about it bad practice? The reason I a... (by Jorge626)
get random number in range [-2..19]
 
can you recommend better way to generate random number within the range [-2..19]:
[4 replies] Last: "the best way..." is very subjective. Do you want to generate random ... (by deleted account xyzzy)
static pointer as class member leading to valgrind still reachable
 
I have following code example. Class foo has a private member bar, which is a static string pointer. In the main function I am doing something completely not re...
[3 replies] Last: Try: #include <string> #include <memory> class foo { public: foo... (by dutch)
I need to display number of bills and coins
 
Here is the question: What I need help with is displaying the number of bills and coins. Write a program that will repeatedly allow the user to determine th...
[1 reply] : Nvm I solved it myself. #include <iostream> using namespace std; voi... (by dumdumFlame)
Binary Tree, function isn't reading in
 
I've got this program thats supose to translate morse code into the message. I am having a problem with reading in. If I remove the "read functions" and place...
[9 replies] Last: *******************************************************************... (by CodeNovice01)
asking for code
 
Fill a one-dimensional array with 10 integer random numbers between -2 to 19. Print all numbers in the array in a row, separating each number with a tab (for e...
[1 reply] : How much are you willing to pay for the code? If the answer is non-ze... (by Ganado)
cin.ignore and clear
 
hello, i wonder about cin.clear(); cin.ignore(10000, '\n'); I want to know i understand these two functions. I think cin.clear, deletes all that is in the buffe...
[8 replies] Last: I am sorry peter i did not see your comment , i must have missed becau... (by MyOnlinePersona)
Not getting the correct vector
 
I'm comparing values of a certain equation and I need to store the best value in a certain variable, in my case current_best_eval , and the vector that leads...
[17 replies] Last: Hi Andy, should "randomArray" be different in each iteration The "... (by kbklpl21)
by dune
Compiler can't see a file that's in the project dir
 
I got some code online that uses the SQLite3 library in a small C++ console program and pasted it in a new Code::Blocks project. Then in the project tree (left ...
[1 reply] : #include "" searches the current directory, then the search path (use ... (by salem c)
Asking for code
 
if i input 5, then the output will be 11 12 13 14 15 12 13 14 15 13 14 15 14 15 15 if i input 4, then the output 12 13 14 15 13 14 15 14 15 15...
[2 replies] Last: #include <iostream> using namespace std; main(){ int n, akhir=15, ni... (by irfanjosh06)
problem with code
 
I don't know what to do after this... Can you help me little bit? my teacher says i can't calculate the all sum in for loop #include <bits/stdc++.h> usi...
[5 replies] Last: sum = sum -= ( 8-i ) * (10-a)*(10-a) / sqrt(a - c) ; Actually this i... (by dhayden)
Hash table with multiple inputs
 
I have an assignment to make a hash table. It is a phone book with names and phone numbers. The issue is that its not just the first name, last name and phone n...
[6 replies] Last: Also, your insert method is buggy. If you're inserting into an empty ... (by dhayden)
The default in my switch statement is looping.
 
Hello I'm a complete beginner in c++.I tried to make a tic-tac-toe game.but in a switch statement, in default to check invalid user input,it gets messed up when...
[2 replies] Last: Hello I'm a complete beginner in c++.I tried to make a tic-tac-toe ga... (by Enoizat)
I've created a linked list however, when I try to print it, the list prints backwards.
 
Hello! I've been working on some project code and the project is basically to read in a file that has contacts in it, put the data into nodes, put those nod...
[3 replies] Last: > So I guess there lies the problem? Pretty much. If you want the list... (by salem c)
by Dee5
Printing pattern (1,2)
 
Hello Im supposed to print diamond pattern which look like --#-- -###- ##+## -###- --#-- The user decides the size of it. I know how to...
[20 replies] Last: Thanks (by Dee5)
How to read in a line that INCLUDES spaces
 
I am trying to read information from a file into string variables. Here is how the data appears in the file: TFTFTFTFTFTFTFTFTFTF ABC12345 TTFFTTFF TTTTTTTTT...
[12 replies] Last: Ok, I have made just a couple amendments to ganado's code. I moved the... (by quantumBob)
0.00 output to calculate %
 
I need to create a class that will display a list of modules in an array. In the array must be module name, module code, assignment 1 mark (in percentage), assi...
[2 replies] Last: Hello StrangerThings, The code in the for loop in "main" is hard to r... (by Handy Andy)
Fstream help?
 
Hey guys, I'm having a hell of a time here. I have an assignment for a college course and I'm tasked with creating a console app that can detect user input, rec...
[1 reply] : Hello H4X0R46, One place to start is http://www.cplusplus.com/doc/tut... (by Handy Andy)
April 2020 Pages: 1... 151617181920
  Archived months: [mar2020] [may2020]

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