General C++ Programming - February 2019 (Page 5)

How can I make a function that prints the value category using decltype?
 
This works for the expression rvalueRef++, but I have to put the 3 part if: auto&& rvalueRef = i(8.8); rvalueRef++; if constexpr (std::is_lvalue_ref...
[no replies]
std::vector<bool>::reference
 
developed a templated class wrapping a std::vector<T>. All was fine until I tried to use it with T = bool. This is how I discovered that in the case of a std...
[5 replies] Last: Everyone seems to agree that std::vector<bool> was a mistake but it is... (by Peter87)
Help with a shopping cart
 
Now I'm still in the beginning stages but I'm just testing out my first 2 functions and I am getting alot of errors on all my dim's... that says redefinition of...
[6 replies] Last: Please see my response in your other thread: http://www.cplusplus.com... (by AbstractionAnon)
by frek
How to create an automatic player using AI in C++
 
Hi all, I'm dealing with a QML ping pong game. https://imgur.com/a/oE8QmAv It now works very well. At the beginning, the ball starts moving automatical...
[3 replies] Last: @Ganado, Thank you so much . :) To be honest, I myself had thought o... (by frek)
Shopping Cart Coupon Help
 
Okay, So the whole program works, I am suppose to have a couponOne, that takes 50 percent off and a couponFive that takes five dollars off. The couponFive works...
[1 reply] : Not sure why this is marked as solved. Line 30: total is not passed... (by AbstractionAnon)
Need help with a C++ Program
 
I have been trying to work on this project for a day now and I am stuck on what to do. The problem I am trying to solve is this: In preparation for the release ...
[3 replies] Last: You need #include s for required headers. If you're going to place y... (by AbstractionAnon)
obj({ ...}) intialization, what is happening ?
 
I wrote something equivalent to the following by accident, and it worked. However, I am not sure what is going on exactly. Are the parentheses just ignored? Wha...
[5 replies] Last: Thanks, everyone for the clarification. And so braces within {} or () ... (by CABrouwers)
>> not Displaying Float
 
I am trying to make a vector class. Here is a simplified version of my code: #include <iostream> #include <cmath> #include <string> class VectorThree {...
[3 replies] Last: Thanks! I left C++ for a while and am having trouble getting these str... (by Reader8765)
Add https support to xupnpd2 mediaserver via lib-curl lib-openssl c++ wrapper
 
Hello, I'm not a developer, but I hope someone could give me some hints how to add https support to xupnpd2 mediaserver (https://github.com/clark15b/xupnpd2)...
[no replies]
by elsa
How to use strcpy() and strcat() functions to create a full name?
 
Hello, I need to use the strcpy() and strcat() functions to assign a full name to the variable fullName. For example, if firstName holds Tom , and las...
[8 replies] Last: I recommend you avoid mixing them you cannot safely mix unless you... (by jonnin)
Return Type Defaulting to Own Class
 
I am trying to write a class and it's functions return types are defaulting to it's own class. I am declaring it in the class and trying to define it later. Whe...
[1 reply] : I signed out and signed back in again and it worked! I guess it wasn't... (by Reader8765)
making a schedule in dev C++
 
I need help to make a schedule on dev C++ This is the code that i have right now This is in my main.cpp /**************************************************...
[no replies]
C++ crash on exit (CryEngine, Ultralight)
 
I'm coding a game in CryEngine and just finished implementing HTML renderer called Ultralight to replace the built in Scaleform UI. Everything works as expected...
[4 replies] Last: I think you're spot on. I threw a dump into WinDbg and if I understand... (by LazyKernel)
Declaring variables, classes, etc.
 
When writing code and one has to declare a variable or class, is it good programming practice to declare it outside the main function or inside the main functio...
[9 replies] Last: Thanks for the replies, I think I will leave it to discretion dependin... (by nicholasjb1996)
by Borneq
Class/module dependency and objects
 
I am importing data from WhereIsIt report. There are “chunks” of data - several dozen of rows, where each row is file info entry. I have class Reader which...
[no replies]
hasKSmallFactors() not giving desired output
 
Hello guys, I am working on a problem where I am supposed to write a function hasKSmallFactors with signature boolean hasKSmallFactors(int k, int n) which retu...
[9 replies] Last: that is about the same logic/idea as what I was replacing the second f... (by jonnin)
Platform differences encapsulation
 
In our app, we need to detect if the debugger is attached to either allow CrashPad to catch the crash or allow the developer to dive into the wonderful world of...
[6 replies] Last: Thank you all for your input! I like the option of having the impleme... (by Anton S)
by elsa
Error: Operand types are incompatible, char & constant char
 
Hello all, As the title states, I have a problem where all the comparison operators are generating an error. The assignment explicitly states that no argumen...
[5 replies] Last: It usually means that the linker can't find a function with the proper... (by jlb)
Help with code that allows exponential problems.
 
#include <iostream> using namespace std; int main() { int x; int y; int result = x^y; cout<<"Please enter a number(base): \n"; cin>>x;...
[3 replies] Last: Great. Thank you so much. (by CodingIsHard17)
Incorrect output behavior when function calls itself
 
I am making a program that gives the user a certain number of tries to guess a hidden word. The compiler outputs the expected behavior except when it comes to t...
[6 replies] Last: The "solution" would be to implement this in terms of a loop instead ... (by jonnin)
February 2019 Pages: 1... 34567... 11
  Archived months: [jan2019] [mar2019]

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