Beginners - September 2017 (Page 13)

Trouble with bubble sort and pointers
 
In the code below, everything I've done is working as expected, except for the function named selectionSort. With that function, it is my intent to use pointe...
[6 replies] Last: however, that's not bubble sort. for (j = i + 1; j <= end; j++) {... (by ne555)
Why does this loop? (probably stupid simple--but I cant think it through)
 
Writing a program that simply converts time. Have the program written and it compiles just fine--however... When the program asks for the user to enter the h...
[2 replies] Last: Andy, Thank you! Sometimes I just have to shake my head at myself (... (by CapitalJeep)
linked lists
 
need for more explanation about linked lists and how they work? thanks!
[2 replies] Last: You might find Section 3 of this to be useful too: https://www3.ntu.ed... (by closed account 48T7M4Gy)
3x3 complex matrix (1,2)
 
I am new to C++. I am trying to read a 3x3 matrix from a file then needs to find eigenvalues and eigenvectors manually. My file is not opening. I am not sure of...
[33 replies] Last: @zeviah5 The methods I used are for dense matrices. If you have matri... (by lastchance)
Exercise Explication
 
Hello guys, Exercise: Implement a sort function that takes a vector of pointers to an interface class, Comparable , that defines a method, compare(Compara...
[2 replies] Last: Thank you for making the definition of interface in C++ clear to me.... (by Icyblizz)
by sezo
need help with output on assignment
 
Object oriented C++ course. Still learning the ways. This is the assignment http://venus.cs.qc.edu/~waxman/211/Score%20the%20race%20211.pdf I am having trouble...
[9 replies] Last: @sezo I had to add a little more to your program, but it works now. ... (by whitenite1)
Help make this better!
 
Hello, this is a simple Roman Numeral Converter It works too! However, it displays weird numbers if you enter anything below 0. I have also made some mistake...
[2 replies] Last: also did you mean move main to the top of the program? yes, you can do... (by jonnin)
vector size() argument ?
 
I tried doing this earlier: void ftnode_client::fetch(std::size_t start=0, std::size_t end=v_result.size() ) { for (const auto & s : make_range(v_result, s...
[4 replies] Last: got it working i understand the theory of templates, but struggle wit... (by bluefrog)
Question about classes with other classes as member data.
 
I am currently trying to make my way through this book "Sam's Teach Yourself C++ in 24 hrs" and am confused about a certain example program. The program is supp...
[8 replies] Last: Ah I see, I think understand these setter functions now. I think this ... (by CameronStevenson)
URGENT ! Need help with my assignment. need to pass up in 8 hours pls pls help
 
Write a C program that displays menu as shown below: Menu 1. Calculate Grade 2. Multplicaion Table 3. Print Pyramid 4. Exit Enter your...
[19 replies] Last: Wait. This is C++ program rather than C. also it uses c++11 features. ... (by codehelper)
variable vector sequence
 
I’ve started to learn C++ a couple of weeks ago and it’s been going quite smooth. Right now I’m trying to figure out how to make a vector (got that down),...
[2 replies] Last: std::cin >> iterations std::vector <int> sequence(iterations); ... (by ne555)
by Kappa
Calling a value from a class to a different class
 
So as the title says, is there a way to call a value of a class user defined function to another class user defined funtion?... for my code below i would like t...
[2 replies] Last: Forgot to reply.. thanks keskiverto!! i actually got it! (by Kappa)
by MrMou6
double variable
 
Hello, how I can do that double variable shows only 2 numbers after dot let say: 20.00 not: 20.00000 by the way im using sfml engine :D code: double money =...
[2 replies] Last: side note but money is often an integer and often 1 is the smallest cu... (by jonnin)
Attempt at bubble sorting
 
trying to sort through an array and find the largest stored value. void findHighestGrade(Student students , int n){ bool issorted=false; doubl...
[2 replies] Last: How many times do you increment j between lines 17 and 20? (by lastchance)
Generating and Sorting numbers.
 
Hello. How can I generate 1 million random numbers and sort them in c++.Can I use a vector to sort the numbers?
[10 replies] Last: Sometimes, you just want some numbers, and that is all you need. ht... (by closed account 48T7M4Gy)
by GSid
isdigit in a simple for loop
 
Hey I am trying to create a program that uses isdigit in a for loop to make sure the input is a digit but when i input 12av34 all i get at port b is 12 please ...
[7 replies] Last: This do you? The previous one is simpler. #include <iostream> #includ... (by lastchance)
Question about Exception.
 
I'm trying to make an exception here to limit 9 characters and the program errors. Am i doing something wrong? cout << "PC " << i+1 << endl; ...
[2 replies] Last: > Am i doing something wrong? Yes; using exceptions for control flow.... (by JLBorges)
help me...i'm beginner
 
why does it say "both ID and PASSWORD are WRONG " eventhough i write id=1,password=2....i thought it just need to say "id is correct"...help #include<iostrea...
[2 replies] Last: i got it now...appreciate that....good man :) (by phongvants123)
Reading txt file into 3d vector
 
Hi people, is it possible to read a txt file with 3 different delimiters (,;#) into a 3d vector of x,y values ("sf::vector2f")? The lines of the txt file have...
[3 replies] Last: another approach might be to: (a) read file line-by-line into std::str... (by gunnerfunner)
I need to write a Program for My Programming class but I am stuck
 
The Program is supposed to repeatedly prompt the user for the three coefficients values,a,b and c, and will then evaluate the expression below and display the t...
[3 replies] Last: My professor wants us to only use ints or floats in this project as t... (by mbozzi)
September 2017 Pages: 1... 1112131415... 21
  Archived months: [aug2017] [oct2017]

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