
please wait
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 + int b → implicit conversion is double how can I do that, bec... |
Feb 17, 2022 at 10:00am
[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 variable is a certain value. The second thread isn't responding... |
Feb 17, 2022 at 7:41am
[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 the value in the switch statement results in run-time errors... |
Feb 17, 2022 at 6:24am
[13 replies] Last: Thanks Againtry, that is an interesting way of using switch statements... (by Julius Caesar1)
|
by shaefayejem
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 and the main difference that I did was put the printing in a ... |
Feb 16, 2022 at 12:07pm
[20 replies] Last: > the globals (which don't have a constructor) aren't initialized by t... (by JLBorges)
|
by sushigotti
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 loops 0 as the input #include <cstdlib> #include <ctime>... |
Feb 16, 2022 at 10:03am
[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 they don't make any sense to me. #pragma once #include... |
Feb 16, 2022 at 12:16am
[6 replies] Last: Thanks! I'll have to watch for those unnecessary includes If the ext... (by mbozzi)
|
by bergjensen33
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 a global char* names , as well as some other C-style strin... |
Feb 15, 2022 at 8:57pm
[4 replies] Last: The second parameter is selecting a random index from the respective ... (by jlb)
|
by Paul50002
need help
|
I am having problems with this code. I am hoping someone can help? I am tring to get my program to open and read and calculate the data from my text file so it... |
Feb 15, 2022 at 5:59pm
[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. I noticed I do not know how to search through STL containers... |
Feb 15, 2022 at 7:44am
[12 replies] Last: #include <iostream> #include <string> #include <map> int main() { ... (by JLBorges)
|
by baked turkey
Trouble with my if statement
|
My code is supposed to output "Excellent enjoy your stay" when true, and "lets try that again" if false. But I am getting the false statement no matter what. I'... |
Feb 15, 2022 at 6:43am
[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. *** stack smashing detected ***: terminated Can someone tell ... |
Feb 14, 2022 at 6:26pm
[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++ (last contact is about 10 years ago) and I am trying to ree... |
Feb 14, 2022 at 6:21pm
[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 compiler will check if the answer is true or not. The actual p... |
Feb 14, 2022 at 12:44pm
[1 reply] : As a first refactor consider. Note no error detection/handling for inv... (by seeplus)
|
by jetm0t0
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 for all good men and women to come to the aid of their party... |
Feb 14, 2022 at 7:55am
[13 replies] Last: @againtry well I'm not sure if you are saying I've waited till late be... (by jetm0t0)
|
by bergjensen33
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 possible card types and a struct , which contains as an ele... |
Feb 14, 2022 at 2:05am
[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 checked older posts on this forum and although they have helped I... |
Feb 14, 2022 at 12:44am
[5 replies] Last: #include <iostream> bool isValid(double); int main() { constexpr... (by deleted account xyzzy)
|
by Hanna1203
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 file, however when runnning the code I get the error message p... |
Feb 13, 2022 at 7:20pm
[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 compiler will sort the letters out. However, when i run the code... |
Feb 13, 2022 at 12:49pm
[5 replies] Last: Yeah, seeplus, I fooked up, not noticing* at the time I was doing the ... (by deleted account xyzzy)
|
by Volapiik
Properly freeing dynamically allocated memory
|
I am having trouble freeing memory. There are many files so I have included only the main portions relevant to the issue. As far as I understand you free memory... |
Feb 11, 2022 at 12:17pm
[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 bunch of roman numerals, do math with them." My professor re... |
Feb 11, 2022 at 10:51am
[3 replies] Last: [quote=tacowo]int romanToDecimal( char r ) // takes in a roman numeral... (by lastchance)
|