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...
[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...
[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 ...
[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...
[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...
[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...
[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...
[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...
[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.
[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 () ...
[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...
[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...
[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 ...
[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...
[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...
[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 ...
[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...
[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...
[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....
[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 ...
[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.