General C++ Programming - March 2018 (Page 11)

Comparing strings of more than 50 characters
 
howdy, I'm trying to compare 4 strings with a simple "if" like this: std::vector <string> _fileNameBuffer; std::vector <string> _filePathBuffer; string fi...
[3 replies] Last: std::mismatch() Returns the first mismatching pair of elements from ... (by JLBorges)
User-defined vector, variance, and standard deviation
 
Basically, I need to write functions for the formulas to act on a user-defined vector. Any advice for a novice?
[2 replies] Last: #include <iostream> #include <valarray> using namespace std; int mai... (by lastchance)
FILM DATA HELP!!!
 
So i've been trying to fix my code for DAYS. It is on a continuous loop and I'm not sure where im going wrong. Also, the getline does not seem to work. Im using...
[4 replies] Last: You can see I added the count value to see what was going on. I figure... (by SamuelAdams)
by heepoo
error 2039 in my code although the function is declared
 
hello everyone, first, i'm writing a C++ client for at least myself for [url=https://wit.ai]wit.ai using jsoncpp and libcurl but, i have some problems: 1. i...
[3 replies] Last: oops, this is sight problem (when it makes you not to be able to debug... (by heepoo)
Passing a passed pointer
 
Hey guys so Im able to pass my Class Object through functions like so void startFight(Player *p) { p->attack(); p->takeDamage(); } thats fine ...
[7 replies] Last: Oh wow okay thanks this will be useful in the project since I create t... (by bradltr95)
Seconds into minutes, hours, weeks and years.
 
I'm working on this program where you input a number in seconds, then its kicked back to you in however many units it makes up, so if you type 50, it will say 5...
[2 replies] Last: Use an array to store how many seconds are in each unit then just walk... (by dhayden)
coping string from acitivity to another in native
 
I want to copy a string from one activity to another activity here is my code I want to copy the g sting to the hell string in the other activity using name...
[6 replies] Last: Google "android jni return string". There's tons of documentation onli... (by helios)
Temperature question
 
Hey guys, I'm stuck. My code runs fine, but every time I try to input a temperature for one of the else if statements, it kicks back with nothing. I'm trying to...
[5 replies] Last: Can you post the "fixed" code with the suggested else statement? I'... (by doug4)
test help
 
hey guys i have a test tomorrow and i have old tests i need you to help me if this is correct or not first picture : http://prntscr.com/ioxuf0 and second pictu...
[1 reply] : 1.c, the behaviour is undefined. 2, a for loop has the form for(initi... (by ne555)
Range-based for loops or for_each with multi-dimensional intra-dependent arrays
 
Hi, I've been using (bad) codes a lot for years, and I want to update them using latest/most optimized c++ tools now. I feel like I just need a little better un...
[1 reply] : The lines 1-5 you can achieve with: double interpolation_term_tab {... (by keskiverto)
handle
 
hello i need help for find what is the range of handle for file? what is the range of handle for keyboard? what is the range of handle for monitor? thanks ...
[no replies]
How Can I Import Values from OBJ file to My C++ Program?
 
Hello Professionals, I have been working with a file that generates the polygons of a certain OBJ file. (in this case, a dodecahedron). I successfully did this...
[12 replies] Last: It's okay my friend. I understand. :) The first two links were picture... (by kindgnice)
Random number based off a percentage
 
Hey guys so Im building a text-based game that has enemies you create through OOP. The enemies attacks are in an array of 4 attacks and I create them like such ...
[3 replies] Last: Oops. My bad. On line 12 the expression should be dodge_successful = ... (by helios)
class definition question
 
Hello everybody, I am skimming through an open source project and I encountered a c++ construct which I can't quite figure out. Basically the class hierarchy...
[1 reply] : See: https://cpppatterns.com/patterns/pimpl.html Nested classes: http... (by JLBorges)
Single "&" Inside The If-Statement in C++?
 
Hello Professionals: Good day. I am currently trying to understand a code from this website, but I don't why there is only one "&" in the IF-statement. Can any...
[5 replies] Last: Thank you @Golden Lizard @fcantoro and @jonnin for your insights. God ... (by kindgnice)
by Joe006
std::bad_alloc
 
Hi, I come across a task while trying to improve my C++ skills. It compiled fine and gives me the correct result. But when executing with a large data, it gives...
[11 replies] Last: Its all good now. Thanks so much for all the help and advice. I try no... (by Joe006)
Boost python on windows
 
Anyone have experience with this libary? I got to the last part of: http://www.boost.org/doc/libs/1_66_0/libs/python/doc/html/tutorial/index.html It says: ...
[2 replies] Last: Ah it's not working. Tried both ways. (by elohssa)
Sorted maps
 
What I want is a map of classes with string index to be ordered by a member of the class. According to this https://stackoverflow.com/questions/5733254/how-can-...
[1 reply] : Maps are always ordered by key. (by Peter87)
by kada17
Formatting oversized columns in output
 
I am having an issue with oversized data for some of my columns. My normal output looks ok but when I have longer than normal data in the dot license or serial ...
[1 reply] : erase the extra http://www.cplusplus.com/reference/string/string/erase... (by SamuelAdams)
class's: how can i use assigment operator on constructor?
 
how can i use assignment operator on constructor? class event { private: function<void (void)> eventfunction= (){;}; public: event () { //n...
[4 replies] Last: thank you so much for correct me (by Cambalinho)
March 2018 Pages: 1... 910111213... 15
  Archived months: [feb2018] [apr2018]

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