Beginners - March 2021

How to add a time lock?
 
Okay, so I made a program and I want the User to no longer have access to it after a certain date which i classify. And i want the program to NOT grab the syste...
[9 replies] Last: You wanted any ideas, but accepted none of them with your pie in the s... (by salem c)
STL vectors
 
I am trying to write 3 different types of algorithms which create arrays using vectors STL( 1-st lesson). When creating vector a and c, size() seems to be corr...
[13 replies] Last: I guess the issue occurs because I was trying to use specifically res... (by MikeyBoy)
by PK Dey
const string& str
 
Could someone please explain "const string& str"? #include <iostream> #include<string> using namespace std; void reverse(const string& str) { siz...
[1 reply] : It passes the string by const reference . This means that the str in ... (by Ganado)
Doubly Linked List iterator
 
Hi everyone, so today I have to deal with doubly linked list and using Iterator in it. I still don't know where i went wrong, please spend sometime help me. Tha...
[3 replies] Last: It's hard to tell without seeing the declaration of DLinkedList<>, but... (by dhayden)
how to get specific text from string?
 
I want to get player name from Chat log. Now I just need to find it from this line (param 1: `5<`2player`` entered, `w1`` others ) std::string str="param 1...
[5 replies] Last: @seeplus, I noticed that, but I have had trouble with the (`) in the ... (by Handy Andy)
by BradyS
Value return function trouble
 
I have an assignment here for a value returning function that uses another function to obtain the values, if any one could help me this is the description:You w...
[2 replies] Last: [quote=salem c]C++ doesn't allow functions to be declared inside other... (by MikeyBoy)
by PK Dey
c = a % b;
 
Shouldn't c be zero when a = 6 and b=9? #include<iostream> #include<math.h> using namespace std; int main() { int a, b, c; cin >> a >> b; c = a ...
[2 replies] Last: Don't confuse division remainder (modulo division) (%) with integer di... (by seeplus)
Sum of Range
 
Hello everyone, I am writing a function to find a sum of a range. I have a function that works in the main function, but I cannot figure how to call the funct...
[13 replies] Last: Yep. As from first principles: S = m + (m + 1) + (m + 2) + ... + (n... (by seeplus)
Random number seems to get stuck in a loop?
 
So, I'm working on a number guessing game in command console. Right now, the player enters a number, the computer has to guess it, points are incremented to th...
[7 replies] Last: If this is for an assignment, you might be doing it wrong. Normally wh... (by dhayden)
by NiceS
Writing to text file
 
Im trying to add in another extra row of data to the checkout txt file whenever a tool is checked out. The checkout file consist data in the form of employee na...
[4 replies] Last: Im trying to add in another extra row of data to the checkout txt fil... (by seeplus)
map, unordered_map...Nope, Vector Of Pairs!!
 
This personal experiment is something new to me. I have a 2d vector of maintenance codes. I wanted to iterate through parts(blocks of rows) of the 2d vector a...
[11 replies] Last: That makes sense. Me personally, I like the unordered same frequenc... (by Brian845)
by medosz
find the largest integer in the array with recursion
 
This program finds the largest interger in the array. I am trying to understand it but I am struggling with the recursion. For example in line 19: max = r...
[8 replies] Last: Thank you for your help. It helped a lot. (by medosz)
by ok304
2 matrices, one with string other with int
 
im trying to make a simple program to practice 2d arrays in c++. the string array is simple name & lastname which i understand so far. the int matrix consis...
[7 replies] Last: thanks! works great and it looks way easier than the version i thought... (by ok304)
Stack in CodeBlocks
 
can somoene explain how this compiles nothing in CodeBlocks. thanks beforehand #include <iostream> #include <stdexcept> #include <string> using namesp...
[4 replies] Last: okay i figured it out, thanks! (by somecuriousguy)
Overloading unary operators
 
Hello! I was trying to overload unary operatirs ++ and --. You can see the code below. And this is the compiler messege: 12:6: error: expected initializer befor...
[2 replies] Last: Keskiverto, I'm really grateful to you! It was a very primitive mistak... (by crueltyfree)
Function problems
 
So I have a project where I have to do the following: The program calls the following functions, which have not been written: •getLength –This functio...
[17 replies] Last: @seeplus, I missed the lack of the space in line 2, but I agree it is... (by Handy Andy)
Help finding duplicates within an array
 
Please help don't know how to do it. I'm done with what I'm supposed to do in my class assignment but the next part "find the same value within the array" which...
[10 replies] Last: Thank you help for the help, I really neeeded it. (by Growthra)
by Pepito
cannot be used as a function
 
Good day, I keep getting this error whenever I want to call the function list(c) it says cannot be used as a function but whenever I use the function loop(a) an...
[2 replies] Last: My bad, sorry I'm just new here, I didn't know threads aren't deleted ... (by Pepito)
Explain me output of the below program (1,2)
 
Explain me output of the below program int main() { static int arr1 ={0,1,2,3,4}; int *p1 ={arr1,arr1+1,arr1+2,arr1+3,arr1+4}; int **ptr=p1; p...
[20 replies] Last: >>I suggest you start analysing I have analyzed the code "pointers... (by sunil kumar g)
Loop not continuing in stack program
 
Hey guys my code is working just fine for a postfix calculator but for some reason, the code provided isn't doing its job and looping properly #include...
[3 replies] Last: cout << "Enter another equation?(y or n)"; cin>> tmp; if(tm... (by seeplus)
March 2021 Pages: 123... 13
  Archived months: [feb2021] [apr2021]

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