Beginners - February 2022 (Page 4)

by n00b1e
Problem with generic struct
 
I need to return type that is implicit conversion of type A and type B. Fox example : double a + in...
[2 replies] Last: template < typename A, typename B > constexpr auto operator+(const A... (by seeplus)
by janac
Sharing variable value between threads
 
I want one thread to be constantly updating a variable and have a second thread respond when the var...
[2 replies] Last: the second thread doesn't seem to be detecting when the variable equa... (by coder777)
This program works fine but I'm wondering if the value in the switch statement in question
 
Is the value in the switch statement is correctly placed? The program works fine and any changes to ...
[13 replies] Last: Thanks Againtry, that is an interesting way of using switch statements... (by Julius Caesar1)
My cout seems to be cutting first character (1,2)
 
Hi, I just picked up c++ and just running through some basic tutorial. Code is using cout and cin a...
[20 replies] Last: > the globals (which don't have a constructor) aren't initialized by t... (by JLBorges)
How do i write if input equals string or if input equals integer?
 
when user inputs a string, code goes berserk. i want it to go to the very last else but instead it l...
[4 replies] Last: Have a look at getinp() in http://www.cplusplus.com/forum/lounge/27995... (by seeplus)
by Kizzle
Nonsensical errors
 
I've been working on my first c++ project and started getting some build errors with this code but t...
[6 replies] Last: Thanks! I'll have to watch for those unnecessary includes If the ext... (by mbozzi)
Segmentation Fault after declaring char* inside function
 
Hello. I was trying to make a name generator for my game project, but to no success. I have defined ...
[4 replies] Last: The second parameter is selecting a random index from the respective ... (by jlb)
need help
 
I am having problems with this code. I am hoping someone can help? I am tring to get my program to ...
[11 replies] Last: Perhaps: // As C++20 #include <iostream> #include <fstream> #includ... (by seeplus)
by Ch1156
Searching through stl containers
 
So I am going through my knowledge of stuff and trying to strengthen up areas that are the weakest. ...
[12 replies] Last: #include <iostream> #include <string> #include <map> int main() { ... (by JLBorges)
Trouble with my if statement
 
My code is supposed to output "Excellent enjoy your stay" when true, and "lets try that again" if fa...
[4 replies] Last: Another version: #include <iostream> int main () { using namesp... (by againtry)
by SHGOVI
stack smashing detected error
 
Q.Basic structure program Unable to find an error. This error comes when running this program. **...
[4 replies] Last: cin be C++, as is cout. ... c would use scanf or scan something and p... (by jonnin)
by kaffee
wxFormBuilder code does not compile undefined reference to `MyWindow::MyWindow(wxWindow*)'
 
Hello all, as the title suggests, I am unable to compile my wxFormBuilder project. I am new to c++ ...
[3 replies] Last: T H A N K Y O U ! you both. What a silly mistake! LANG="en_US.UTF... (by kaffee)
cin.get error - unable to enter input.
 
Hi, I'm writing a code where ten students input either true, false or blank in an array. Then the co...
[1 reply] : As a first refactor consider. Note no error detection/handling for inv... (by seeplus)
Reading and writing different files
 
So the goal is to use ROT13 and read from a file with the words "JULIUS CAESAR" or "Now is the time ...
[13 replies] Last: @againtry well I'm not sure if you are saying I've waited till late be... (by jetm0t0)
Defining struct elements according to an enum value of that same struct.
 
Hello. I'm trying to code a card game of sorts, inspired in MTG and YGO. I've declared an enum of ...
[9 replies] Last: What I am confused is with the terminology, "discriminated." What dis... (by mbozzi)
by bg333
Lowest Score Drop (Basic Homework)
 
Hey guys, I'm sure this exact programming challenge has been posted a multitude of times. I've check...
[5 replies] Last: #include <iostream> bool isValid(double); int main() { constexpr... (by deleted account xyzzy)
Unable to load text file
 
Hi! I need some help with why my code is not working as it should be. I would like to read a text fi...
[4 replies] Last: however the full path in a string variable usually needs \\ or / (wi... (by jonnin)
Code for sorting a char array?
 
Hi, so I was practicing the cin.get function and the question is that u input values in and the comp...
[5 replies] Last: Yeah, seeplus, I fooked up, not noticing* at the time I was doing the ... (by deleted account xyzzy)
Properly freeing dynamically allocated memory
 
I am having trouble freeing memory. There are many files so I have included only the main portions r...
[13 replies] Last: > Did I miss something? You need to download the latest rar file from ... (by salem c)
by tacowo
Using ifstream& as a reference parameter to an ifstream within another function?
 
Hello, I've gotten the apparently classic programming student problem of "here's a text file with a ...
[3 replies] Last: [quote=tacowo]int romanToDecimal( char r ) // takes in a roman numeral... (by lastchance)
February 2022 Pages: 1234567
  Archived months: [jan2022] [mar2022]

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