Beginners - April 2018 (Page 2)

Code Doesn't work
 
Problem was basically to output 2^n for any inputted integer n. I cannot see why my code doesn't wor...
[1 reply] : Hello fat person, you are doing what's known as shadowing a variable... (by Ganado)
for loop: to draw a square a box
 
#include <iostream> using namespace std; int a; int b; int c; int main() { for(c=0;c<...
[1 reply] : Please use code tags when you want to post something formatted. Ex: [ ... (by Ganado)
by vcref
Runtime error sum of fractions
 
I have to sum two fractions and simplificate them. It works for some cases, but the system gives me ...
[6 replies] Last: ... (by vcref)
calculation error
 
Write your question here. #include <iostream> using namespace std; int main() { i...
[3 replies] Last: It does display something, or not display something, depending on the ... (by zaphraud)
Fixing memory leak
 
I'm having trouble fixing a memory leak in my code. Based on using valgrind, the memory leak is occu...
[8 replies] Last: Thank you for all the help. I was able to fix the memory leaks. (by qwerty123456)
Rotating square matrix many times!
 
Hello everyone! Here I have a code that rotates the square matrix clokcwise and I am trying to do th...
[1 reply] : #include <iostream> #include <iomanip> #include <vector> using namesp... (by lastchance)
splitting input from cin
 
#include <iostream> #include <vector> #include <cctype> using std::string; using std::v...
[2 replies] Last: I get it now, thank you so much tpb (by alfie nsugh)
Subtracting two doubles gives an odd result
 
Hi I've run the following code: double d = 342.389; double d_d = d - floor( d); //what...
[3 replies] Last: You can use an epsilon value. bool almost_equal(double a, double b,... (by Ganado)
Having Trouble Reading a text file and assigning data to different variables/arrays
 
I'm Sorry for the huge message, I figured It would make it easier to understand if you actually saw ...
[7 replies] Last: I cannot Thank You enough for your help. Learning Coding has been quit... (by Mjimmie1)
multiplication of matrices using vectors
 
i am trying to multiply 2 matrices (src) & (src_trans) by passing matrices(2d vectors) to the functi...
[1 reply] : Hints: #include <iostream> #include <vector> constexpr unsigned ROW... (by Enoizat)
C++ bandwidth with functions
 
Hi guys, I made-up this program with no intended purpose. However, I noticed that setting a band wid...
[1 reply] : doesn't work “doesn't work” isn’t a good description of an iss... (by Enoizat)
How to write the sum of counter[i] using for loops.
 
Im a newbie. And i want to know how can i add up the sum of array using a for loop and stop until a ...
[5 replies] Last: //So if i input let say 15 alphabet, the middle one is 8. this could... (by closed account SECMoG1T)
Theater Ticket Sales Project
 
When i run the program it runs into an error when displaying. mostly in the seatarrArrangment fuctio...
[1 reply] : whenever you open a file it is your obligation to check if that file o... (by closed account SECMoG1T)
by hanes
Running only if statement, but not else
 
For some reason when I input 'y' it runs the if statement as intended but when I input something els...
[2 replies] Last: Ah, can't believe I overlooked me using the assignment operator there,... (by hanes)
Random Maze Generate
 
can you help me with this function? it's not working. looping infinitely. void Maze::generat...
[5 replies] Last: Can you show the complete code we I can run it. (by Thomas1965)
Rounding Issue, Radian Angles and Distance
 
Noob Here. I have a problem where I have to round my outputs to 4 decimal places and I'm getting we...
[2 replies] Last: For your angle function use the two-parameter function atan2( y2, x2 )... (by lastchance)
Program crash
 
Hi there, I'm having trouble with my code. The program is supposed to take in a file and read in the...
[5 replies] Last: Hello Drake5006, While testing the program I realized line 31. whi... (by Handy Andy)
help with function
 
https://www.geeksforgeeks.org/smallest-difference-pair-values-two-unsorted-arrays/ i have to make an...
[1 reply] : Seeing as you are using vectors, I would look into std::sort (...) : ... (by VX0726)
Please help
 
Ok, so I've got a lil' two player word guessing game where the first player enters a 5 letter word i...
[1 reply] : The way I see it, you could store all of the guesses in the vector. Th... (by VX0726)
[C++] function pointers
 
Hi, I have a namespaced function inside a shared library: void foo::Bar() {}; If the co...
[1 reply] : Yes. The loader loads code into the processes address space, and it's... (by kbw)
April 2018 Pages: 1234... 25
  Archived months: [mar2018] [may2018]

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