Beginners - May 2020 (Page 4)

Better way to input (x, y) with cin or getline(cin, var)?
 
Hi, one of the questions on my homework asked me to write a program that determines the perimeter length of a triangle given 3 (x, y) vertices. Didn't have an ...
[3 replies] Last: Functions are what you need void inputPoint( Point &p ) { cin >> p... (by salem c)
Issues with conditional operators and decimals
 
Hi. I'm new here and to C++. The code is correct as long as the value entered is whole but if the value is a decimal, then it doesn't work correctly. Any id...
[1 reply] : Change int to double and you should be good. Non-integers means floati... (by Ganado)
Autograde Fail?
 
I'm currently using an online (chegg) copy of Cay Horstmann's Big C++ Late Objects 3rd edition. I'm on chapter 7 trying to work out one of the examples on stru...
[2 replies] Last: Yep, it was the extraneous << endl on the end of each line. Thanks! (by dakotad8218)
String to Date with exceptions c++
 
I have a task to make static method getDateFromString in class Date that receives the date as a string as the only parameter and returns it as Date. I also nee...
[11 replies] Last: that's good to hear! (by malibor)
by Dalski
Deciphering cppreference.com
 
I've been stuck on lambdas for a couple of days now https://www.learncpp.com/cpp-tutorial/introduction-to-lambdas-anonymous-functions/ obviously any idiot can c...
[8 replies] Last: The reason it doesn't work is because you didn't put a semicolon after... (by TheToaster)
by Dalski
Where Can I View The std:: Namespace?
 
Where can I see everything which lives inside the std:: namespace in C++? https://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=std
[6 replies] Last: Where can I see everything which lives inside the std:: namespace in ... (by mbozzi)
Re Order array or use lookup table?
 
I have an array of objects and I want to either call them in a specific order or re order the list entirely. Also is there a way to sort based on an objects var...
[3 replies] Last: if the objects are large, fat things you can make an array of pointers... (by jonnin)
Still Having Isssues
 
Hi Guys! I am still having trouble with the following code. I need to replace the IP address to contain the value (127.0.0.1). I have tried many things witho...
[5 replies] Last: Im sorry but I thought this was a beginners forum... well, yes. But m... (by jonnin)
how to create a card pack.
 
hey guys. i'm new to c++. i've only learned about the basics of c++. so i've been given the task of creating a card game. the card consists of 55 cards that has...
[3 replies] Last: You can check out my card class here. https://www.cplusplus.com/forum... (by markyrocks)
Eigenvalue Code
 
Write your question here. Hello. I have a code here which takes a matrix in a txt file as input and by using power iteration method, householder transform and ...
[7 replies] Last: So there is nothing wrong with the code. Thank you very much lastchanc... (by azizcoktu)
File handling (1,2)
 
Hi...below is my code So am trying to read and get information from firstfile that will then by used for a search In secondfile..and well when i ran it a got...
[20 replies] Last: Thanks for the assignment. Have you learned about functions? Class m... (by dhayden)
by yin
How do i compare the usernames in my text file with user's input?
 
I want to compare u.username (user input) to the strings in my text file names.txt. My understanding of the code I implemented: 1) I made a string u.usernam...
[6 replies] Last: Hi Ultralegendary, that would work for C-style strings. For strings th... (by Repeater)
help
 
reate a multi-class program, where one class will actually reference another. This one will be a simple replica of a RPG-style character. In this program, you ...
[3 replies] Last: Use this as a starting point: enum class player_type { warrior, thie... (by Thomas1965)
help please!! card game
 
hey guys i'm new to c++. i've only done basic oop. so we have to create this card game. can you guys help me create the cards, shuffling and dealing. these are ...
[1 reply] : if your goal is to learn OOP, let us know. typically a deck of cards... (by jonnin)
by hbcpp
Implement std::list emplace method
 
After these two discussions(links below) about implementing SFINAE I was ready to start coding the operations of a doubly linked list. https://www.cplusplus.com...
[16 replies] Last: @ TheToaster I am missing something very important as I am not unders... (by hbcpp)
by Dalski
arr.end() Print Value/ Index Position
 
Looking at the find function, I'm playing around with this tutorial https://www.learncpp.com/cpp-tutorial/introduction-to-standard-library-algorithms/ & I'm str...
[2 replies] Last: Thanks dutch, sorry for my ambiguity, I was just trying to understand ... (by Dalski)
help please!!
 
can someone help me with this. i have created a player class to display player names and points. points need to add up when the games go on. at the beginning po...
[7 replies] Last: thank you andy. it was really helpful (by saliya1964)
Passing an array using for_each loop (1,2)
 
Hello there! I am learning lambda functions. Is it possible to pass an array into a vector using for_each loop and then print concurrently? #include <iostr...
[24 replies] Last: thanks for all your help, people!! i really do appreciate it!! i will ... (by gongong)
Game of Life - Code help
 
Hi, I'm programming Conway's Game of Life for my c++ class . I've been working for hours trying to figure out why it's not working, here's the function that ch...
[3 replies] Last: ***EDIT - Just to update so everyone knows this is solved. I ended up... (by AvantGardener)
Multidimensional arrays program not working
 
Write your question here. Hi, I am new to multidimensional arrays, and I am struggling to understand why this program of mine isn't working as it should. Karen...
[8 replies] Last: Thanks, it is much more clear now (by Theloneinteger)
May 2020 Pages: 123456... 17
  Archived months: [apr2020] [jun2020]

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