General C++ Programming - March 2014 (Page 30)

by dnulho
std::sort (iterator, iterator, custom) will not compile
 
I am trying to use std::sort to sort a vector of complex objects using a custom function. However, it keeps erroring "Unresolved overloaded function type". en...
[6 replies] Last: Thank you, fixed. (by dnulho)
Multi-threading
 
I'm currently trying to log real-time data by using boost::thread and a check box. When I check the box, the logging thread starts. When I uncheck, the logging ...
[1 reply] : m_threadSendData.interrupt(); // interrupt the thread Threads genera... (by Cubbi)
to compare data_members of a objects store in std::vector
 
Overview of problem : I am using std::vector to hold objects of Subject. Now this vector contains lots of objects( with lots I mean 10-20 objects at max) . The...
[1 reply] : #include <iostream> #include <string> #include <vector> #include <alg... (by JLBorges)
by yugank
Using a delay function
 
I have been working on this project to develop a slot machine game. In that I intended to show rotation of slots slowly so as to show true effect of revolving ...
[1 reply] : http://en.cppreference.com/w/cpp/thread/sleep_for (by MiiNiPaa)
by mjlohr
Problem
 
What does this program display? I know it has errors in it but I have no idea how to fix them. By the way, I am very new to this. :) Any ideas? #include "st...
[3 replies] Last: #include <iostream> #include <iomanip> using namespace std; int mai... (by kbw)
by quayda
String with Vowel Removal
 
I'm trying to write a program that uses a loop to remove vowels from words. I'm really bad at this programming thing, so I'm super sorry if my code looks awful....
[3 replies] Last: What is s? Where did you tell compiler anything about it type, size, c... (by MiiNiPaa)
C++ operand programming homework
 
My question is Write a program that has the user enter two integers and then has the user enter a math operand to do the mathematic operation on the two inpu...
[15 replies] Last: Bonus (without ifs or switch): #include <functional> #include <iostrea... (by MiiNiPaa)
Boost serialization archive versions
 
Hope everyone is doing well. I'm having an issue with boost serialization. I have serialized a file on my ODroid U2 using Boost v1.53. I'm trying to deserial...
[no replies]
error LNK2019: unresolved external symbol
 
I know my SDL is set to all the right directories. I don't know what is causing this. I also have all my dll files in the debug folder. It has worked before, I ...
[no replies]
Why assign out-of-range value to signed integral type will generate machine depedent results?
 
Can anyone give me an example of a value about how can it varies dependent on the machine? I just cannot think of any. Thanks.
[2 replies] Last: #include <iostream> #include <limits> int main() { long long v ... (by JLBorges)
by mjlohr
bubble sort
 
Hi. I need a lot of help with this. I do not understand it at all. Can someone please explain this in simple terms? Thanks, Mary Trace the bubble so...
[1 reply] : Bubble sort is explained here. https://en.wikipedia.org/wiki/Bubble_so... (by kbw)
i/o functions and operations
 
i want to make a quiz for that i have decided that i will store a number of questions in a text file and randomly display them in the output window. for that i...
[no replies]
by Gyiove
Run both in cpu and graphics card.
 
Hello! Is there possible to control what controls the process? Like somehow switching from graphics card to cpu and vice versa. Basically i changed in my n...
[no replies]
by larjy
Code doesn't do calculation
 
Overview: I'm creating a code to simulate quantum tunneling current. I'm getting the code to output data on a spreadsheet file, and it all works except the ...
[6 replies] Last: I can't thank you enough! That's fixed it. Brilliant, I really apprec... (by larjy)
by Gyiove
weird double values on cout
 
Hello! Here is code first: //fp_screen.h class fp_screen{ public: double fps; double xx3; // fp_Screen.cpp fp_screen::init() // called before everything {...
[5 replies] Last: Problem solved i think. // I calculate fps outside here if( xx5 < ... (by Gyiove)
expression must have a pointer-to-member type
 
I created a class called Polynomial that asks the user for coefficients and exponent. I also created a function that would add the two polynomials. I'm stuck o...
[4 replies] Last: The first line of code that he posted does that? So does the second... (by cire)
How to stop console from pausing?
 
Just a quick newbie question: I'm doing a console application and whenever I open a .exe using system(), the console pauses and does not run the next instructio...
[1 reply] : Do not use system(), obviosly. Use WinAPI: http://msdn.microsoft.com/... (by MiiNiPaa)
by Chubby
why doesnt display?
 
#include <iostream> .... Rectangle r; Point xny; Asking user for info .... // I am trying to display the x and y... but it show x:0 and y:0 //Disp...
[10 replies] Last: I see it because r is one who have value from user and xny come from n... (by Chubby)
by kimi86
Assignment operator for a class with reference
 
Class A {..........} Class B: {.... private U& u;} I need to write the copy constructor and assignment operator for Class B above Copy would look s...
[3 replies] Last: To quote the C++ FAQ, C++ gives you the choice: use the assignment op... (by Cubbi)
Creating string representation of unsigned char bits
 
Hello, I need to convert the bit representation of an unsigned char into a string. so like 254 would be "11111111" I'm having some trouble where no matter w...
[4 replies] Last: #include <string> #include <limits> std::string bin2string( unsigned... (by JLBorges)
March 2014 Pages: 1... 2829303132... 36
  Archived months: [feb2014] [apr2014]

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