Beginners - May 2018 (Page 10)

Quotient Void
 
So this is our assignment: Write the C++ code for a void function that receives three double variables: the first two by value and the last one by reference...
[2 replies] Last: pass a pointer to quo, not quo itself. or have the function return ... (by zaphraud)
Get line from txt file into string (every line if wished)
 
Howdy strangers, I want to get the content of a .txt file into strings. I already got this: string content; ifstream d...
[1 reply] : Hello minimalistisch, Welcome to the forum, What you wan to do is so... (by Handy Andy)
Write access violation thrown when trying to call an array-modifying function twice EDIT: Now a read access violation.
 
I have a function that modifies the contents of an array. the function works just fine when I only call it once. If I call it twice, it throws a write access vi...
[16 replies] Last: Thank you, the issue was resolved. Also nice catch in reroll, you are ... (by Endersmens)
Is there a way to share a variable between instances of a class, but not between instances of the class containing it?
 
I have a class called Monster that inherits from class Entity, which has a variable called size. I want every Monster to have the same size by definition, but I...
[4 replies] Last: The problem is that you're saying that every Entity has an individual ... (by dhayden)
Need help with basic calculator code
 
So the code I have here works as expected, but I'm trying to figure out a way to store the result of each if statement into a variable. My reasoning for this i...
[1 reply] : Hello BmoreCoding, Welcome to the forum. To do what you want you bas... (by Handy Andy)
Having trouble with my class and vector working
 
I have written my code for an employee management system that stores Employee class objects into a vector, I am getting no errors until I try and compile, I am ...
[1 reply] : On line 125 you are trying to find a string in a vector of Employee... (by lastchance)
Problems with Inheritance.
 
What would be the changes I need to make to my code in order to make sure it can actually add my numbers together? It asks me to do the following: Create a...
[3 replies] Last: main.cpp #include <iostream> #include <sstream> #include <vector> #... (by ScottyYDg)
by wtbe
Java Header files
 
I'm learning Java this term. What I've realized is that all of the header files we create in C++ is now provided to us free of charge in Java. However, is there...
[3 replies] Last: C's (and C++'s) compilation model is designed so that compilers can op... (by mbozzi)
by Thesar
Accumulate and Find_if (LAMBDA)
 
I am doing a program where the user chooses to create a list either with ints or doubles. The classes need therefor to be templated. In these classes i also hav...
[3 replies] Last: You fillList function does nothing. Look at this line: std::generat... (by tpb)
A program that reads a file.
 
I need to write a program that would take student names and GPA from a file and print the names of students with GPA >3.4 into another file, my problem is that...
[4 replies] Last: Thank you so much guys for your amazing help and support, I'm already ... (by isuckatcpp)
Finding the longest route in a graph
 
Hello, here's a snippet of the code to give you an idea of what i'm doing here. The function is suppoed to: *return the starting node that gives a longest DFS ...
[1 reply] : ¿so? ¿what's the problem? (by ne555)
by Bokka
Please, help me to convert a Python code to C++
 
Hello Forumers! I am new to C++, but I have to write a simple program to calculate the CRC16 of a Modbus string. I have only to write that, I have not to do an...
[9 replies] Last: EXACTLY what I want! YOU are my HERO! Thanks a lot to everybody!!! (by Bokka)
Something called Stack Overflow
 
So I'm a high school student learning C++. My project is to make a basic-terminal based inventory system for the Chemistry lab. Since we haven't reached Data Ha...
[2 replies] Last: You have 1000 stock objects in stack. One stock object contains: 2 in... (by keskiverto)
help with returns
 
Can i return like that? int a,b; int sum(a, b) { sum = a+b; return 0; } or only like this? int sum(int a, int b) { return a+b; } ...
[3 replies] Last: @erikas37 -- Strive for declaring variables as close as possible to th... (by icy1)
by monae
Calculate fallingDistance and kineticEnergy
 
Hi Everyone. I am new to C++ and in my first programming class. Our instructor has asked us to write a program that calculates the Falling Distance (using formu...
[9 replies] Last: You should calculate 0.5gt 2 in your function fallingDistance(t) - un... (by lastchance)
Visual Studio 2017 not working
 
I just started programming C++. When I tried the shortcuts it didn't do anything. When I try to run or debug the code, the option to do so is grayed out. I don...
[5 replies] Last: @MondayPenguin, PLEASE learn to use code tags, it makes reading your ... (by closed account E0p9LyTq)
Quick Sort won't sort an array that has 4385 or more elements
 
I cannot get quick sort to work with an array that has more than 4384 elements. I have three slight variations of quick sort that I have been told work, and the...
[5 replies] Last: Also, your custom swap is erroneous. Please try to understand the dif... (by icy1)
Testing a program
 
Hello, I have written a program to identify local trees in the area. Basically all you have to do is choose between 2 questions (A or B) each question leads to ...
[6 replies] Last: Since not all the ID's are going to be the same length, it might need ... (by closed account NCRLwA7f)
convert string to decimal
 
Hi everyone , i have a text file with strings inside it. now i need to read that file and convert the strings into a decimal value. like for example i have t...
[6 replies] Last: in c++ characters are integers, 1 byte in length. there is no 'conver... (by jonnin)
Why are Marks not copied in my array?(streams)
 
I am trying to copy characters from a file into a 2d array. Here is a screenshot of my notepad http://prntscr.com/jgexjx My problem is my Marks aren't replacing...
[2 replies] Last: It is trying to read two integers, so it will stop when it either hit... (by chrisamgad)
May 2018 Pages: 1... 89101112... 19
  Archived months: [apr2018] [jun2018]

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