Beginners - November 2019 (Page 14)

Use pushback method to add data from a file to a vector
I'm trying to add data to a vector using the pushback method. It is giving me an error when trying to run that I don't quite understand. #include <iostrea...
Nov 5, 2019 at 9:13am
[5 replies] Last: Line: 1455 Seriously? (by lastchance)
How can I ensure these three numbers are not equal?
At the beginning of a function I declare three random values like so: int commencer = rand() % somevector.size(); int midst = rand() % somevector.size(...
Nov 5, 2019 at 5:46am
[5 replies] Last: @TheToaster That is correct. The if statement will only be executed ... (by closed account E8A4Nwbp)
Trying to get rid of "text" in code
Hello, I am pretty new to C++ but I am trying to modify this code I found online. It is an AR ruler and I want to modify the code so the application will run...
Nov 5, 2019 at 4:33am
[1 reply] : This code is C#, not C++. (by helios)
HANGMAN PROBLEM: Cannot accept both uppercase and lowercase as valid
Hello, I badly need help with this one. I tried the other suggestions using tolower function to convert my to-be-guessed word (i.e. "guesword") to all lower cha...
Nov 5, 2019 at 12:43am
[2 replies] Last: Oh wow, I knew i suck at programming but I didn't think it was this ba... (by WywrdAF)
by AL88
Why am I getting "Undefined reference to vtable"
Why am I getting "undefined reference to vtable enemy when I link the object files for this game engine code. Some guys on an irc channel told me to add a virtu...
Nov 4, 2019 at 11:37pm
[1 reply] : You need to make sure that the virtual methods inherited by the Enemy ... (by TheToaster)
How to change a grade?
If anyone could, I need help accessing a score of a student in order to change that grade. Here is the code for it: void changeScore(Student* gradeBook...
Nov 4, 2019 at 10:35pm
[2 replies] Last: Hello codeq12, Without more code to see what you have done one can on... (by Handy Andy)
How do you select a random value from a vector and pop that value too
Hi, How can you select a random value of a vector, and at the same time pop THAT element?
Nov 4, 2019 at 10:25pm
[4 replies] Last: Just for giggles I revised the code to use templated functions for the... (by deleted account xyzzy)
by Acania
Problem with the length of the circle
I have this program and I needed to complete some blank spaces I did a few of them but some of them I;m not sure what to put. Sorry for having some dumb questio...
Nov 4, 2019 at 9:40pm
[8 replies] Last: it's working . thank you ^^ (by Acania)
by xoox
Binary to Decimal W/ the presentation of equation
Im trying to make a program that converts binary to decimal but having the needs to show the process of the convertion (Sample image below) https://ibb.co/jypt...
Nov 4, 2019 at 8:59pm
[13 replies] Last: #include <iostream> #include <string> using namespace std; string ma... (by lastchance)
Passing an entire object to access its private members
I want to organize a private vector member by passing the entire object to a public function that is not inside any class. I have a class Parent, class Child,...
Nov 4, 2019 at 8:54pm
[2 replies] Last: What’s bad in simply having your class which contains your std::vect... (by Enoizat)
how do i convert the min_max function to the method of the IntArray class?
how do i convert the min_max function to the method of the IntArray class? class IntArray {private : int a ; int n; .......... }; void min_max(int n,int ...
Nov 4, 2019 at 8:30pm
[3 replies] Last: Stop double posting, Repeater is already said what was wrong in the ot... (by Ganado)
by Acania
Help
I have to see what's wrong with this, I have already fixed some of it but now I get this message(expected initializer before ‘-’ token) on a debugging site ...
Nov 4, 2019 at 8:19pm
[2 replies] Last: thank you so much. I was able to fix it ^^ (by Acania)
Return nothing in Linked List
Hello, I wrote Linked List. I want to return nothing in the Delete method when Linked List is empty. How can fix my code? now when the linked list is empty, th...
Nov 4, 2019 at 6:29pm
[3 replies] Last: You probably need to return something from your "delete" function when... (by jlb)
Traversing list is not showing expected number of nodes.
Hello, I wrote the method to add nodes to singly linked-list. In this case adding 10 nodes to the linked-list. Then I attempt to traverse and display how many n...
Nov 4, 2019 at 4:49pm
[2 replies] Last: Good work JLBorges. Thanks. (by mrpear2020)
Read a text file into a binary tree
I am working on an assignment where I need to read a file into a binary tree, sort it, and use it to encode a message. I know how to write code to sort and a lo...
Nov 4, 2019 at 4:15pm
[4 replies] Last: Thank you this is a huge help. I'm working on it now and will let you ... (by TwirlingCherries)
File line missing/overwritten ; reassigning grade
I am having issues with my code overriding some information. For example, when "Joe Sullivan" and his average score is printed out, it prints out twice and tota...
Nov 4, 2019 at 3:21pm
[3 replies] Last: I think you just want to change gradebook to a vector. Then lines 156-... (by dhayden)
Why is this an error?
I've been writing this Work-Out Program today and I'm still unfamiliar with Array's but I keep receiving an error for both of these functions. I'm trying to jus...
Nov 4, 2019 at 12:23pm
[7 replies] Last: Hello CodeNovice01, I loaded your code into my IDE and when I tried t... (by Handy Andy)
Dynamic Value in array size
Hello, I want to get row and column from the input. How can I do it? int main() { int row; int column; int myarray ; }
Nov 4, 2019 at 12:02pm
[2 replies] Last: You have to allocate the memory dynamically. C++ Standard Library has... (by keskiverto)
using a vector of type struct to output
#include <vector> #include <algorithm> #include <iterator> struct Student { // ... double average; // ... }; std::vector<Student> listOfHigherThan_X(...
Nov 4, 2019 at 12:01pm
[1 reply] : Please DON'T delete your question once you've got your answer. It mak... (by MikeyBoy)
by Euno
Help - Want to add two numbers using for loop (1,2)
I want to add int1 and int2 without using arrays, how can I do so? #include <iostream> using namespace std; int main(int argc, char *argv ) { int X = 0...
Nov 4, 2019 at 11:31am
[29 replies] Last: You're acutally asking us openly to help you cheat on your homework, s... (by MikeyBoy)
November 2019 Pages: 1... 121314151617
  Archived months: [oct2019] [dec2019]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.