Beginners - January 2021 (Page 2)

error: expected unqualified-id before ‘return’
 
I am trying to create a piece of code for an assignment that is due in 17 hours. it needs to be in t...
[14 replies] Last: i didnt use all of the feautures i intended on, such as the case secti... (by JackLadYT)
Simple File Copying
 
I've been trying to figure out a way to simple copy all the files in the current working directory t...
[4 replies] Last: The only way I see to do it is the unattractive directory iterator whi... (by jonnin)
stuck in linked list basics
 
here how head->next is getting address of tail.. nowhere we have specified head->next=tail or head...
[9 replies] Last: node(int aa) : a(aa) {} This is a class constructor that takes on... (by seeplus)
Receiving the data from file to the function
 
I need a small help for my c++ function. I am writing a function called "calculate". The Pr array i...
[6 replies] Last: Thank you JLBorges, it worked , thank you so much again (by learner999)
Calculate Sinx in C++
 
Hello, I'd like to calculate sinx with the below formula. My answer is wrong. for example sin(35) i...
[11 replies] Last: I know the OP didn't want recursion, but I quite like this method. It'... (by lastchance)
find the sum of numbers in a .txt file
 
i need to find the sum of rounded to one number after the dot numbers(don't know the right way to ca...
[5 replies] Last: Thank you!! (by laura fidarova)
Functions
 
In this program create a one-dimensional array of n random integers from the range [a,b], where n, a...
[2 replies] Last: Consider: #include <random> #include <iostream> #include <limits> #... (by seeplus)
Text Adventure Like Torn.
 
I have been trying to make a text adventure game based on torn, but with only two choices. Employe...
[3 replies] Last: Note that you could also be using else if chains to prevent redundant ... (by Ganado)
by EmanCS
Reading text file and save in vector
 
I have a text file consisting of 5 lines. int int int unknown number of int separated by space ...
[2 replies] Last: Thank you. It works. (by EmanCS)
by EmanCS
free the memory
 
Hello How can I free the memory allocated by grid ? int **grid; grid = new int* ; for(int ...
[5 replies] Last: Thanks a lot. It works. (by EmanCS)
by munim
how to make a simple college library program.
 
hello there i want to make a simple college library program in which one can add the information of...
[2 replies] Last: A good start would be to declare a struct Book with the required field... (by thmm)
I do not understand "foo.get() = 15" in the code.
 
I do not understand foo.get() = 15; as the function get has no parameter, what does foo.get() ...
[3 replies] Last: @seeplus @Furry Guy thanks for your replies. (by wanabeahacker)
by Temss
Group numbers
 
I have numbers in a single array (30,20,25,15,50,30,80..). I want to group all numbers possible in a...
[1 reply] : Is there a reason why (15, 50) isn't group 2? What have you tried so ... (by Ganado)
Concatenate 2 lines in a vector
 
I have this program that cleans up some text files for me. I wanted to see if I could take any comm...
[8 replies] Last: seeplus's response worked perfectly!! (by Vendetto)
by M09
Memory limit
 
Code is supposed to transform all the letters in uppercase and to print the sum of the digits. Ex: ...
[5 replies] Last: Perhaps something like this which doesn't use stream insertion - but j... (by seeplus)
Why isn't my code displaying the correct output?
 
I am reading from a text file. Asking the user to input an inventory number and finding that invento...
[5 replies] Last: Hello lg77756, I wish I could have finished this last night, but I co... (by Handy Andy)
How to get rid "+" word in loop
 
How to get rid "+" on output example: i input: 6, the output is: 1 + 2 + 3 + 4 + 5 + 6 + = 21 but i...
[5 replies] Last: #include <iostream> using namespace std; int main() { int n {}, su... (by seeplus)
Solve my assignment please!
 
Make a sequence of number from 3n+1. If one of the sequence got even number then make it half from t...
[2 replies] Last: and what part of this are you having difficulty with? Can you obtain n... (by seeplus)
structuring a game project
 
I'm working on a basic 2d game framework with Sdl, but I'm not sure how to make instances and game a...
[8 replies] Last: I suppose singletons will work for the managers, I'll avoid globals an... (by DevReign)
How to search sentence in cpp
 
how to make program like this: in the cpp file there is a sentence: Dave buy 2 mangoes Felix buys ...
[5 replies] Last: sorry for late answer. thank you everyone I appreciate it. (by siabapet)
January 2021 Pages: 1234... 11
  Archived months: [dec2020] [feb2021]

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