Beginners - June 2021 (Page 9)

by eqis
Class fields
 
Hi, I'm trying to create a class with an object field. I want to create the object on the stack rather than the heap, but when I define it, it seems to call ...
[2 replies] Last: #include <iostream> using namespace std; class Test { private: ... (by Manga)
while loops, txt file and arrays
 
Hi I'm currently working on something for the future where I want to read through a comma separated txt file with a known amount of columns but not rows and I w...
[11 replies] Last: Do you mean the: std::vector<double> row; for (double val; iss >> val... (by keskiverto)
Getting Results from the Set
 
Hi all, std::set<int> setx{ 100, 100 , 20}; for(auto &elem : setx) { cout<<"Print the set" << elem; } Output : 20,100 But I want ...
[3 replies] Last: @lastchance Thank you so much. It's working (by Shruthi LS)
no suitable conversion function from "std::basic_string <char, std::char_traits<char>,std::allocator<char>>"to "int" exists
 
My code is unfinished at the moment but the problem I'm having is the "name" of if(isspace(name .substr(i, 0} is giving me the error no suitable conversion func...
[3 replies] Last: Also note that passing vector<> by value (as here) causes an extra cop... (by seeplus)
Create an h file for binarySearch program
 
I've created a program that asked the user to enter a name if the name entered then computer says the name is in the array. I'm trying to modify this program so...
[2 replies] Last: DON'T use include... in a header file. This WILL cause problems at som... (by seeplus)
I have some problem with my code about mode
 
This code supposed outputting the mode of the input, problem is, this code just outputting 0. Do you guys have any idea? #include <iostream> using name...
[2 replies] Last: if anyone want the answer, it's in line 13. I forgot to add a line. ... (by ChloroPhyte)
Need help creating a card game similar to Rock Paper Scissors but with different objectives
 
Hello, I seek assistance in creating this game it is similar to RPS(Rock,Paper,Scissors) but with different objectives. ============================== Card | B...
[4 replies] Last: I think Botched it up, didn't think this through. I was supposed to pr... (by Growthra)
looking for an easy to install and use c++ compiler
 
Hi Everyone, I am looking to get back in to writing some code in C++. I have Visual Studio. I am having problems using Visual Studio. I would like to use anothe...
[11 replies] Last: how to use notepad++ with cygwin: http://www.edparrish.net/common/npp4... (by anup30)
Repeat a print out value of the last data . (1,2)
 
Currently this code repeats a last value it prints it twice choiceBB choiceB choiceB2 choiceB2 stated I had textfile with: /*Example of textfile * ...
[27 replies] Last: @seeplus I really first believe that was the case but the Template has... (by SITHESH)
by siid14
Three errors on overload pb
 
Been working on this problem about overloading function and private function but I got a couple of errors that I trying to solve but it's not successful until n...
[6 replies] Last: Hello siid14, Understanding the problems better I came up with this: ... (by Handy Andy)
Why is this valid code?
 
See the following: #include <iostream> using namespace std; template<class X*> void y() {} int main() { return 0; } Why can I cre...
[3 replies] Last: https://en.cppreference.com/w/cpp/language/template_parameters Becaus... (by keskiverto)
while loops, txt file and arrays
 
Hi I'm currently working on something for the future where I want to read through a comma separated txt file with a known amount of columns but not rows and I w...
[1 reply] : Please don't duplicate post. See http://www.cplusplus.com/forum/beginn... (by seeplus)
by Ch1156
Creating Multiple instances of one object
 
So I am playing a game called Factorio and I have a bunch of storage chests for items and it got me wondering how that's implemented. My guess is there's a stor...
[10 replies] Last: Interesting thank you! (by Ch1156)
Having trouble with for loop
 
The code itself "works" as in it doesn't bring any errors, but it isn't working as intended. What I was hoping to do was to get it to say something like: I hav...
[1 reply] : else is binary, what I mean is you have if this, then that, else other... (by jonnin)
Array and txt file
 
Hi I have a 4 by 4 comma separated txt file named val.txt that looks like 1,2,3,4 2,4,6,4 1,2,7,8 9,3,1,2 for example. I want to read it into an 4 by ...
[9 replies] Last: #include <iostream> #include <fstream> using namespace std; int main... (by lastchance)
June 2021 Pages: 1... 789
  Archived months: [may2021] [jul2021]

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