Beginners - March 2022 (Page 4)

by zy96
Travelling salesman problem solver.
 
Hi all, I am actually working on one C++ program to solve a travelling salesman problem. Here's the...
[11 replies] Last: It has 2 member variables and one constructor that takes 2 strings. H... (by seeplus)
Program doesn't execute correctly
 
Hi everyone, as soon as I execute the program that I got below, it first calculates for a couple of...
[6 replies] Last: I'm using MinGW on Windows on VS code.. Thx for all the help i got it ... (by AustrianProgrammer)
Pass by reference function
 
I wrote this program to turn it into a pass by reference function, but I don't know where to start o...
[3 replies] Last: [Duplicate - See http://www.cplusplus.com/forum/beginner/282706/ ] (by seeplus)
Passing by reference without global
 
I am not sure what I am doing here, I was given a formula to use in the passing by reference and my ...
[12 replies] Last: Assuming the calculations are correct: #include <iostream> #include... (by seeplus)
Char & int input
 
Hey guys can i ask how to make my code accept both int and char input?
[2 replies] Last: A variable has a type and it's value can only be valid for the specifi... (by seeplus)
Mergesort using iterators gives nonesense output
 
Hello together! I'm supposed to implement a mergesort algorithm using iterators. I've implemented t...
[2 replies] Last: Thanks a lot for helping out! (by Mae4ashy)
Inventory program
 
Hello, new to C++ and this forum too. I am currently going through object oriented C++ classes at my...
[3 replies] Last: that using a vector and then deleting from a vector would be ideal, h... (by seeplus)
by ThatYe
Initialize a variable with an expression
 
Hi, Is it impossible to initialize a variable with an expression such as double perimeter { widt...
[8 replies] Last: My code could have been a lot better by seeing your codes and reading ... (by ThatYe)
#include <S.h>
 
You mean this piece of software? https://github.com/Kraus-Lab/groHMM
[6 replies] Last: Poor netiquette, but probably wasn't a spambot. But that's what happen... (by Ganado)
Issues with 'if-else loop..
 
I am working on a project(again) and am running into an issue with this code. I am trying to choose ...
[5 replies] Last: As the same prompt/input is required for each plan, why not as a start... (by seeplus)
Stringstream not working
 
Hi, I don't understand why the last row in the terminal is not 5. When I comment out "ss >> name" or...
[3 replies] Last: Why not simply: std::string input, name; std::getline(is, input,... (by seeplus)
by danyef
stderr: terminate called after throwing an instance of 'std::length_error' what(): vector::_M_range_insert
 
0 I need to implement a simple version of schedule for monthly tasks. For example payment of el...
[2 replies] Last: Use the debugger to trace through the code so see where the error occu... (by seeplus)
Issues with 'for' loop..
 
I have been working on this problem for at least an hour. "First, read in an input value for variab...
[4 replies] Last: In the OP code above, if the >> numIn fails because a non-number is e... (by Ganado)
rouge \n
 
Hi, Can someone explain closer why a "\n" prints after the second "You wrote". Terminal: hi; a Y...
[3 replies] Last: Presumably OP means a "rogue" newline as opposed to a red one. :-) (by DizzyDon)
by ThatYe
Program that detects repeated words
 
I don't understand in details how this little program detects adjacent repeated words in a sequence ...
[16 replies] Last: #include <iostream> #include <string> #include <cctype> int main() ... (by seeplus)
Taking byte stream (1s & 0s) and storing them in a uint8_t array
 
I am trying to take this byte stream of information (1's and 0's) and im trying to store this in a u...
[3 replies] Last: #include <iostream> #include <bitset> #include <iomanip> int main() ... (by againtry)
Count how many times a solution is printed
 
For the life of me, I cannot figure out how to count each time I print the solution, and the total n...
[1 reply] : Well you have a return statement. Which you ignore all over the place... (by salem c)
Does the compiler do anything during runtime?
 
I'm reading C++ Primer 5th Edition by Lippman. In the chapter leading up to the topic of smart point...
[7 replies] Last: It might be helpful to review the process of compiling C++ code into a... (by deleted account xyzzy)
by AAAbb7
Trouble declaring a user
 
I keep getting this syntax error for my code: __tester__.cpp: In function ‘int getCountWatchedMovi...
[5 replies] Last: My getter/setter rant: I'm not a fan of getters and setters when used ... (by AbstractionAnon)
by Pen72
Given integer sequences
 
Given three integer sequences A=(a1,a2...ana) ,B=(b1,b2...bnb) , C=(c1,c2...cnc) Find the n...
[3 replies] Last: Yes, it worked. Turned out the data type should be uint64_t to hold th... (by Pen72)
March 2022 Pages: 1234567
  Archived months: [feb2022] [apr2022]

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