
please wait
c++ function |
I have these words ( burger, hamburger, chips, Cola, Sprite), I need to write a function to take print like these: Chose your order from (0 - 4) 0: Burg... |
Feb 6, 2022 at 5:13pm
[5 replies] Last: #include <iostream> #include <string> #include <vector> #include <ss... (by seeplus)
|
pointer / array |
how to read line number 4, and why we would use it ? int i; int numbers ; int* iPointer; ... |
Feb 6, 2022 at 4:06pm
[8 replies] Last: It basically means that the address of the first position of the array... (by tahasheikh2k)
|
by janac
std::greater not working with sort
|
Why isn't std::greater working here? I have two versions of the code below. The only difference is in the first I used my function cmp() as the third parame... |
Feb 6, 2022 at 10:45am
[3 replies] Last: L35 sort(my_vect.begin(), my_vect.end(), greater<MyClass> () ); ... (by seeplus)
|
by Volapiik
C- How to properly access and deallocate memory used by a pointer of another struct.
|
So assuming I have two structs where game_t struct has a board_t type pointer to remember all the information about the board. The board member variable cells ... |
Feb 5, 2022 at 11:49pm
[9 replies] Last: They haven't taught us to use debuggers yet A debugger is not a pan... (by mbozzi)
|
by CodeChaser
Pointer beyond end of array
|
I found these informative videos, but I am bothered by the presence of a pointer beyond the end of an array. Is it common to see pointers go beyond scope and b... |
Feb 5, 2022 at 4:00pm
[3 replies] Last: That there is a well-defined 'address one beyond the end of an array' ... (by JLBorges)
|
by Mandavel
General questions and guidance from pros (1,2)
|
Hi everyone, I'm in an online C++ video class, about 46 hours of instruction. I'm about a quarter of the way through the class, really enjoying it and excite... |
Feb 5, 2022 at 2:22pm
[28 replies] Last: That all makes great sense now. better not to make those blanket state... (by Mandavel)
|
by beethekid
Function is not incrementing correctly
|
Background information: - member is a vector of pointers to Student objects - m is a student object - I am trying to add pointers that point to a Student o... |
Feb 5, 2022 at 11:11am
[3 replies] Last: There's a couple. Possibly the easiest is to keep a vector of members ... (by seeplus)
|
Is there any way to clean this up? |
I had an assignment where we had to create a program that used a recursive function to test whether a string is a palindrome. We had to have a value-returning r... |
Feb 5, 2022 at 11:05am
[8 replies] Last: or using iterators: #include <cctype> #include <iostream> #include <... (by seeplus)
|
by beethekid
No matching constructor for initialization error
|
//this is the main function #include <iostream> #include "Student.h" #include "StudentClub.h" #include <vector> #include <iomanip> using namespa... |
Feb 4, 2022 at 11:10pm
[3 replies] Last: Why a std::vector of pointers? std::vector<Students> works just as ... (by deleted account xyzzy)
|
How to swim when jumping in the C++ deep end |
Hey All! I have been tasked to take over a project. There is no one to help. I haven't looked at the code yet, but was told it is C++. Will someone PLEASE give... |
Feb 4, 2022 at 3:49pm
[7 replies] Last: @Duthomhas - Great information, thank you. @thmm - Fix bugs & add new ... (by ComputerCowboy)
|
by Kanyddyo
Menu option that prints the inserted inputs
|
I am writing a simple code that solves a systeam of two linear equations inserted from a user. One of the options of the Menu is to print the inserted equations... |
Feb 4, 2022 at 1:38pm
[2 replies] Last: Perhaps something like: #include <iostream> #include <string> int ... (by seeplus)
|
by DinoGuy
program isn't catching words
|
Hi peoples I'm learning c++ as a college course. This class strictly prohibits using strings, so arrays only Part of our homework was to write a function ... |
Feb 4, 2022 at 12:56pm
[3 replies] Last: > This class strictly prohibits using strings, so arrays only There's ... (by salem c)
|
by Michael4733
GUI guessing card game
|
I would like to try to make a guessing card game using GUI and c++ on visual studios. Here is the brief description of the guessing card game on the google doc... |
Feb 4, 2022 at 7:57am
[1 reply] : The screenshot on Google drive looks like a WinForm application. One ... (by thmm)
|
by ansch
Confusing output of this code
|
Let me apologize in advance for choosing this unspecific title. I had problems finding a good one, since i dont really get what the problem here is. So given... |
Feb 4, 2022 at 2:37am
[4 replies] Last: #include <iostream> int f3() { std::cout << " test3 "; return ... (by againtry)
|
by hdcpp64
c++ to c
|
Can anyone please convert this code from C++ to C OR just give me a C solution for this problem: Positive number N, find all combinations of 2 * n elements s... |
Feb 3, 2022 at 4:34pm
[13 replies] Last: In practice, yes: std::numeric_limits<T>::is_iec559 is true on almos... (by JLBorges)
|
by Rakib771
Recursive operator overloading for std::vector
|
This is my piece of code for overloading '+' for vector. template<class T1, class T2> auto operator+(const std::vector<T1>& vec1, const std::vector<T2>& ... |
Feb 3, 2022 at 3:55pm
[6 replies] Last: @lastchance, Thanks a lot. Now I see where I was tripping. The problem... (by Rakib771)
|
by RuehrbbdiM
Questions about validating inputs
|
When I try to cin three integers and cout “not valid” after entering all three of the inputs, it turns out that as soon as the first integer is not valid(fo... |
Feb 3, 2022 at 10:53am
[1 reply] : Correct. Once stream extraction can't properly extract, it fails the s... (by seeplus)
|
by rooha88
For loop creating an odd number at the beginning
|
So I want to print even numbers in reverse from an integer that the user inputs. However, the first number that gets outputted is strange and I cannot understan... |
Feb 3, 2022 at 3:21am
[8 replies] Last: You are getting that error because you are not compiling as C++11 or b... (by deleted account xyzzy)
|
by Volapiik
c - reversing an array of strings.
|
My goal is if I have array of strings such as "hello", "world", "dog" calling reverse should ensure it becomes "dog", "world", "hello". In reverse, char*... |
Feb 3, 2022 at 1:45am
[2 replies] Last: jonnin - Yes that seems to fix my issue perfectly. I appreciate your a... (by Volapiik)
|
by Nick72c
Help with Heap and Pointers (1,2)
|
Below is my first attempt to use 'new' to allocate heap memory, and 'memset' to initialise the address indicated by a pointer. When using memset - How coul... |
Feb 2, 2022 at 6:51pm
[20 replies] Last: According to some experts modern C++ is about expressing intent. If st... (by thmm)
|