General C++ Programming - May 2016 (Page 8)

by Xriuk
Assignment operator reallocation?
 
struct A{ int a; string b; } A var = {2, "test"}; // This creates my object var = {3, "test2"}; // Does this reallocate memory or reuse it? ...
[2 replies] Last: @AbstractionAnon Thanks! (by Xriuk)
a singleton template
 
<Modern c++ design> has give a SingletonHolder template, but I think it is too large, who can give a simple version that can be builded on visual studio 2013/20...
[no replies]
different time with same input
 
Hi everyone, I write a code for reverse nearest neighbor query. I run an experiment to check the performance of my algorithm. the metric is CPU cost in secon...
[14 replies] Last: > I found that I can get consistent results if I put "sleep 60" in bet... (by JLBorges)
Best way to check for Sm. and Lg. Straight?
 
Given 5 dice, each with a value of 1 - 6. What is the most succinct, expressive and elegant solution you can think of to identify a large straight? I know two t...
[11 replies] Last: +1 That's pretty awesome! :) (by Aaron Vienneau)
Place Words from String into Array
 
Hello! I am trying to get only the words of a string to store into an array. For example, the string text == "cat rat Shark mouse" should cause the array n...
[3 replies] Last: It depend what version of Visual Studio you use. Have a look for View... (by Thomas1965)
by Roson
Call of nonfunction
 
Hello everyone, I'm currently creating a program. I've created my own header files. I can call most of the functions into the main(). only two of them i cannot...
[4 replies] Last: show us a sample at least (by Ericool)
change a data in a line of a file
 
hi guys, may i knw are they any way to change a data in a line of a file??? eg: halo bye girl change to: halo boy girl.
[2 replies] Last: google type refactoring batch file , then call it from your code. very... (by Ericool)
Shogi(Japnese Chess) in C++
 
I am done with promotion of pieces. bool promotion(char CB , int EC , char &turn) //EC-endcoordinate { if((CB[EC ][EC ]=='p','s','n','l') && turn=='b') ...
[7 replies] Last: > I have made check function ... I have to made checkmate function ...... (by JLBorges)
Display different random numbers' result in multiple 2d arrays
 
I'm trying to display different approach of random numbers in multiple 2D array, but the result that i got is the same. All my 2D arrays had the same results. ...
[7 replies] Last: @hwan97 I have no idea how to determine a winner, as I have NO idea o... (by whitenite1)
If Statement - Using Two Numbers
 
Hi, I just began learning to code C++ the other day, so bear with me. I was trying to make a simple program where you enter your name and age and it repeats ...
[2 replies] Last: Thanks a lot :) (by mateivad)
Function pointers
 
Hello everyone I'm working on serialization mechanism so far I've implemented one with inheritance and polymorphism, however this creates a certain problems wit...
[11 replies] Last: Wrap the call in a polymorphic call wrapper. http://en.cppreference.co... (by JLBorges)
Pokemon Text game (HELP)
 
hello! so i need some help badly on my program i am making about pokemon. it is text based game and must have requirements etc etc. so the only thing i need no...
[1 reply] : Your fourth "for-loop" in the project is incomplete. More specificall... (by Roberticusfromperiod6)
by Xriuk
Template specialization
 
I have an event system like this: // Default template template <class... P> class Event{ public: void bind(std::function<void(P...)> callback); void trigge...
[1 reply] : Something like this, perhaps: #include <iostream> template < bool /... (by JLBorges)
help please
 
Writing a program using pointers instead of arrays. im wrinting a program that ask for the number of stuedents. then dynamically allocate an array(one to hold t...
[3 replies] Last: Thanks Necip, i didn't know about pointer of a pointer, I will have to... (by almytee ran)
merge sort dividing in three ways instead of two
 
Hello, I am modifying a merge sort program that instead of dividing a list into two, it divides it into 3 instead and do its thing. so far, I have this. #in...
[3 replies] Last: You should look over descriptions of the sorting algorithms again, as ... (by Zhuge)
skgesigOSCrash () crash..!!
 
Hi, Application is crashing with below mentioned stack traces: (Server details: Linux 2.6.9-67.0.7.ELsmp #1 SMP Wed Feb 27 04:48:20 EST 2008 i686 athlon i386 ...
[2 replies] Last: Ok, Thank you !!! (by mmujawdiya)
delete[] operator
 
Hi, Please have a look at the snip-code below: double* f1(); vector<double>* f2(); void fct() { double* f1_data = f1(); vector<double>* f2_data = f2(); ...
[5 replies] Last: Thanks. What if the highest value of f2 is in the third element ( ... (by closed account G1vDizwU)
Help with classes.
 
Hello guys, I have an issue with my classes, when I try to add and subtract it does not update the number of the fish I have. It runs fine until I start selling...
[5 replies] Last: Thanks everyone! sorry aha i figured it out after @Moschops gave me a ... (by bb0yth0r)
pointer to function not working.
 
Trying to pass the pointer from getArithmeticFunction(op) to appropriate functions above. Want to pair the character to a function access.(I have cut out the gu...
[7 replies] Last: code is written both for the compiler to read and for the programmer ... (by technologist)
by aatwo
const reference error
 
Hey guys. I am looping through a list of objects and returning a constant reference to an object meeting some condition... but I am getting the following error:...
[3 replies] Last: I think you misunderstood the meaning of &. It says if you work with t... (by ne555)
May 2016 Pages: 1... 678910... 17
  Archived months: [apr2016] [jun2016]

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