Beginners - July 2021 (Page 4)

Doubts in Class & function
I am new to C++, only know some simple c++ basics. While studying some codes in c++ related to class, I have some doubts on the followings 1. inline PlatformMa...
Jul 17, 2021 at 10:16am
[16 replies] Last: The example by seeplus did just that. Here is another: std::vector<i... (by keskiverto)
by vboro
Memory game pair generating?
Hi! I would like to make a simple cmd console memory game. I have the idea how to do the logical part behind the entire game, however, I'm kinda stuck at the...
Jul 17, 2021 at 7:45am
[8 replies] Last: Thanks everyone for the answers, I got the solution :D And @whitenite1... (by vboro)
Dice roll function
Does anyone have an experience playing Senet? It's an eqyptian game that I have been tasked with writing a program for. how would I go about writing a "dice ...
Jul 16, 2021 at 10:17pm
[4 replies] Last: how would I go about writing a "dice roll" function for a 5 sided dic... (by deleted account xyzzy)
Thread (sleep) one second then calls the method to update it by a second
I have a 12 hour clock and a 24 hour clock. I need to have a thread that sleeps one second then calls the method to update by a second. I first tried the getc a...
Jul 16, 2021 at 1:14pm
[5 replies] Last: That's not how it would usually be coded. Use mod and int division T... (by zapshe)
Help with program
I'm trying to get this program to only ask if the user would like another question after the 5th correct answer. I think I'm a ways off. Can anyone walk me thro...
Jul 15, 2021 at 9:05am
[3 replies] Last: #include <iostream> #include <cstdlib> #include <ctime> int generat... (by seeplus)
When to line break when printing a one dimensional array as a multidimensional one?
Let's say I have an array char arr but I want to print it linearly, breaking lines when appropriate to get a 8x8 square. a, b, c, d, e, f, g, h //newline i...
Jul 15, 2021 at 6:12am
[7 replies] Last: Look at the size of the declared char array, a maximum of 64 character... (by deleted account xyzzy)
by MrASR
How to fetch text between 2 texts or end of text with regex ?
How to fetch text between 2 texts or end of text with std::regex ? #include <regex> #include <iostream> int main() { const std::string s = "Ips...
Jul 15, 2021 at 12:18am
[1 reply] : Something like: std::regex rgx("liripsum +(\\w+)(?: +sapsum|$)"... (by dutch)
Heap Priority Queue for to-do list (1,2)
For this assignment I have to implement a class called HeapPriorityQueue. I have to create a Driver function that will have a to-do list of task with highest pr...
Jul 14, 2021 at 2:51pm
[30 replies] Last: Got to to run. Thanks for your help @seeplus I really appreciate it. (by Lacy9265)
Online C++ Simulator
Hi, I am looking for a good online C++ simulator. Need suggestions. Thanks.
Jul 14, 2021 at 9:50am
[5 replies] Last: cpp.sh looks fine. No. It only supports upto C++14 - nor the lates... (by seeplus)
by MrASR
How to use substr but use variable in c++
I want to fetch code between "is " & " ok" text using substr from string str #include <iostream> #include <string> int main () ...
Jul 14, 2021 at 9:45am
[3 replies] Last: You should start the search for ok after the position of is in case ok... (by seeplus)
lower bound
I am doing hackerrank questions and one requires the use of lower_bound, so i read it on the cpp.reference, and it says "Returns an iterator pointing to the fir...
Jul 14, 2021 at 12:39am
[2 replies] Last: Look at what std::vector::end() means: It is PAST the last element ... (by deleted account xyzzy)
I cannot move onto the next line in the file
I have this code where I cannot move onto the next line I keep feeding my variables the same stuff every time for example Two-Story 5 43 2012 3670 389000 8960 T...
Jul 14, 2021 at 12:16am
[2 replies] Last: Every time you go to read data into your properties variable, you're o... (by zapshe)
Setting true or false by user
So im trying to do something, ask questions and then find out a character, if i have a bool, lets name it isMale, as a variable for the question if a character ...
Jul 13, 2021 at 11:05pm
[2 replies] Last: If you want the user to type "true" or "false" you can use the I/O man... (by mbozzi)
How will i add this in?
Hi, im brand new to coding, some context. i found a tutorial on youtube on how to code a game and i followed the video, but now i wanna make it more unique. i a...
Jul 13, 2021 at 6:40pm
[3 replies] Last: > Any fix to that? Yeah, it's something you need to write. It's li... (by salem c)
printing a linked list
Hello, I am learning linked list, and have come across something that I am having issues with. It is more related to pointers i guess, but the pointer is in use...
Jul 13, 2021 at 5:34pm
[1 reply] : the second loop will dereference a null pointer if the list is empty, ... (by jonnin)
hi, i need help with my coding because the calculation of the cgpa doesnt appear :(
my calculation of cgpa doesnt appear. please help. #include <iostream> #include <sstream> using namespace std; struct gpa { string grade ; int ...
Jul 13, 2021 at 9:38am
[2 replies] Last: For a slightly different take on this using an array for the subject n... (by seeplus)
Stop after catch in C++
Hello, After catch show function from t4 executed. I'd like to stop the program after the catch. I'd like to create just three objects from the test class. o...
Jul 13, 2021 at 9:17am
[4 replies] Last: The use of exit() here isn't the best as that's an unexpected side-e... (by kbw)
Need help
Question is : Consider the class declaration and main() function below. There are two errors in the main() function. Name the errors and explain how to fix them...
Jul 13, 2021 at 6:22am
[7 replies] Last: There are two errors in the main() function. Name the errors and expl... (by keskiverto)
Want help , been struggling with this :(
A college offers diploma course with five set modules each. Define a class Student as an ADT that uses separate files for the interface and the implementation....
Jul 12, 2021 at 4:17pm
[3 replies] Last: please bare with me Hold yer horses, buddy! This is not that kind of... (by dutch)
Overloading + , - and * operators (long)
Question we got was : Define a class Pairs with two integer data members, f and s, where f represents the first value in the ordered pair and s represents the ...
Jul 12, 2021 at 4:15pm
[2 replies] Last: The operator = * - don't need to be friend functions. They can be just... (by seeplus)
July 2021 Pages: 1234567
  Archived months: [jun2021] [aug2021]

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