Beginners - February 2020 (Page 5)

C++ Recursive Function to Copy the Contents of a Linear Linked List into an Integer Array
 
Good Evening, I'm trying to write a function (or functions) that copies the contents of a linear linked list (with integer data members) into a dynamically allo...
[8 replies] Last: Thank you all for your assistance! Sorry I didn't respond sooner. (by confundido)
')' error throughout code
 
I'm in the process of writing a program, and when I go to run it, the only error I get is ')' expected before 'x', ie the lines with the math equations. I've tr...
[1 reply] : double bmi = (weight / (height x height)) x 703; Here is your probl... (by TheToaster)
File reading problem
 
How can I .txt file ( foo.txt) load and store in string variable as it is in file? I need to load foo.txt and store it in string example have in foo.txt I ...
[5 replies] Last: Hello pajaPatak, Although Manga has a nice simple program I see one... (by Handy Andy)
Learning Structures, stuck reading in (1,2)
 
Hello again, I am working on my first struct program and I am stuck. I always have issues with reading in. It reads the first and second string then the first ...
[21 replies] Last: In MostGoals, I'd store a pointer to the player with the most goals ra... (by dhayden)
Copying a struct to dereferenced pointer to a struct.
 
Hi guys, I need a quick sanity check, can I copy struct like on the example below? struct MyStruct { int a{ 0 }; float b{ 0 }; bool c{ 0 }; }; MyStruct ...
[2 replies] Last: Thanks for your input. Indeed the problem was in C# marshaling, it tre... (by Unspoken)
students info problem with structures c++
 
So I started to learn C++ and I need to solve this exercise with structures. I need to write a program which reads students from a group then display them.The ...
[8 replies] Last: That was the problem.It works now. Thank you for your help! (by valiciousx)
Thread number seems ridiculously high.
 
Hi, I have a program that is supposed to print out the thread ID along with other information, but... The thread numbers are super high. 6295792 high. That doe...
[8 replies] Last: I wonder why it gives me a zero for each ID. (by jjordan33)
Link List
 
I am working on a Link List. I'm a little confused with nullptr, and how to declare it. From this snippit can you help me figure out why it's creating an error?...
[6 replies] Last: Thank you for that, I had no idea I needed to alter settings for the c... (by CodeNovice01)
Read into APMatrix
 
My question is, how do you read data (just a bunch of ints) from a file into an AP matrix from the “APMatrix” class.
[6 replies] Last: With that kind of attitude and thinking, you won’t last long in com... (by againtry)
Basic question on lambda 'add' elements function
 
Hello, this should be simple, but I am running into the following problem: I need to use a lambda function to add elements in a vector - OK. Problem is, if I c...
[3 replies] Last: Very good thanks. (by mrpear2020)
Clarifying What A Tuple is in C++
 
Hi all, I apologise if this question is a bit pedantic, but I've been struggling with this all day and the more research I do the more conflicting and vague...
[2 replies] Last: As always Jonnin I am hugely grateful. You're my MVP! (by ExponentialP)
c++ using a member function to place one object inside another
 
So I have two classes UnsortedType and Appoinment. Appointment accepts user input as "1/23/1999 Coffee" which would result in 1 as the month 23 as the day a...
[3 replies] Last: for anyone curious the solution was I accidentally had the x object in... (by Volapiik)
by kmce
reading info form a vector pair and array
 
I have an vector declared as vector<pair<pair<int, int>, int> >adj ; is it possible to iterate through the vector and search for a value stored in the first ...
[7 replies] Last: If we go back to your original declaration,you could do something like... (by Ganado)
by seatea
Reading from file - Overloaded operator problem
 
Hi! I have a program that's supposed to store people in a database. My program is working so far, but I have a problem reading from file after I save it to ....
[4 replies] Last: The operator<<(...) does not match the operator>>(...). I suggest that... (by coder777)
Expectedy copy constructor not elided
 
I have the following class: class IntArray { private: int m_size; int *m_array; public: IntArray(int s) { m_array = new int ; } ...
[2 replies] Last: Got it know. And fixed it. Thanks. (by artaxerxe)
by joe809
Reading Lines from Input String
 
I'm trying to figure out how can I read the lines from a string of a user input. I have a function outside of int main(). The way I want to do this is that for...
[5 replies] Last: I made the change, but nothing. Please show your modified code and li... (by coder777)
by EJW
code review request: simple adder
 
This is a simple academic adding program. It inputs an integer, then an operator, then a second integer, and calculates and prints the result. I want to impro...
[2 replies] Last: It is well-thought and well-organized. However, there are a few proble... (by Duthomhas)
Validating input
 
I have this blackjack 40 assignment for my c++ class. How would i validate the input so that the user cannot type any other number or letter. #include <io...
[7 replies] Last: That was already there in his template, but other than that we are not... (by moe 6734)
by kmce
how to create an iterator for a vector pair
 
Hi, i have a vector pair, that I would like to create an iterator for so i can iterate through, but I cant seem to figure out how to create one, hoping some one...
[2 replies] Last: yes sorry its a array too for a adjacency list. Thank you, I will try ... (by kmce)
Error in comiling code for sensor
 
The error that I get once I compile my code is "E0040: expected an identifier" on this line of code where it says "max". std::size_t scale = std::max({ size_t...
[5 replies] Last: The error that I get once I compile my code is "E0040: expected an id... (by Enoizat)
February 2020 Pages: 1... 34567... 13
  Archived months: [jan2020] [mar2020]

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