General C++ Programming - July 2016 (Page 12)

Help with checking for a straight
 
I'm have a small issue with evaluating a straight in a seven card hand, where you want to get the highest 5 card straight. I can get highest 5 card straight ...
[4 replies] Last: went with this instead for (int i = FACES; i >= 1; i--) { if ((_c... (by closed account SETp4iN6)
Dont know what type to use for this lambda parameter
 
I have a function max_palprime(n) that is supposed to find the highest palindromic prime less or equal to n. This function also works together with other two: p...
[5 replies] Last: > Would you advice the use of std::size_t in the other functions Defi... (by JLBorges)
&&
 
#include <iostream> int main() { int x = 1; int&& x1 = static_cast<int&&>(x); int&& x2 = x1; } //why a compilation errror?
[3 replies] Last: @gedanial, Thanks! @cire, it is equal to: #include <utility> int ma... (by Wu zhen hai)
After searching and obtaining a record, how can one erase the found record from a file ?
 
I have written this method to search a row (line of comma separated strings) from a text file, once found, the contents of the record should be erased. Where i...
[11 replies] Last: Adopt the conventional dbf serialisation style. Incorporate an additio... (by closed account 48T7M4Gy)
glew linking problems
 
Hi all, I'm new here. So forgive me if this is obvious, but I've been struggling for hours on this today! PROBLEM I'm following an SDL/OpenGL tutorial o...
[5 replies] Last: @AcarX, Your example is a user-defined function, not a library functi... (by closed account E0p9LyTq)
my testing life
 
Reported for the following reason: "Spamming and inappropriate content"
[no replies]
Inheritance and array allocation issue
 
My current two projects has me delving into the finer points of C++. If you read any of my previous issues, you may know some of this already. I have a "Layer...
[3 replies] Last: I found the problem myself. Since I was accessing mItemCollection wit... (by primem0ver)
Olympiad Question
 
Hi, Recently I have tried to do few Olympiad problems to get my logic up to speed however whilst doing a question, I was left confused with the question. To el...
[2 replies] Last: @Peter87 That drawing out was amazing thank you for helping me actual... (by closed account 13bSLyTq)
by elay
program crashes in emplace back
 
const std::vector<sf::Vector2f>& getSnakePosition(const std::vector<Tail>& snakePosition) { std::vector<sf::Vector2f> ret; for ( std::vector<Tail>::...
[4 replies] Last: Also, I just realized you are returning a reference to a local var... (by elay)
by cotro
Weird reflection of image elements with a targa image
 
Hi, I am currently doing a program that reads an image in the targa format, does some processing on it and then write back in a new image. If I just read and w...
[3 replies] Last: No, only one will work, because the data is laid out in memory by rows... (by Duthomhas)
Visual Studio
 
I downloaded Visual Studio 15 plus 3 updates, 1, 2, and 3, but I cannot find the icon. any suggestion or advise? I read it may be in the parent directory
[1 reply] : I have visual studio 12 and the executable is named "devenv.exe" her... (by leryss22)
Print c++ bool getting question mark
 
So i am trying to debug some code. But everytime I print a bool variable I kept getting a question mark sign on console if (this->Keys ) { Ball->Stuck = G...
[4 replies] Last: A quick web search suggests that GLboolean is often defined as unsign... (by Peter87)
by aatwo
Corrupt pointer on function return
 
Hey guys. I just got told off by my boss for a snippet of code and in the interest of self improvement I decided to seek further clarification on what is wrong ...
[9 replies] Last: Those two snippets are not like what OP posted. MyObject* GetMyObjec... (by helios)
return type deduction fails whyen moving to C++ 14
 
Hi, I downloaded the following code and it seemed to me that we could benefit from moving it to C++ 14. I thought it was a matter of changing the return types ...
[5 replies] Last: > why the replacement of return types in the original code presented h... (by JLBorges)
No matching function for call to 'enterATab'
 
I keep getting an error message "No matching function for call to 'enterATab' " and I just can't seem to figure out what is going on. When looking online for so...
[8 replies] Last: The problem is in your enterATab function. Why do you enter the data i... (by Thomas1965)
Read all images from a folder
 
Hello , I have the next sequence of code, and i want to read all images from folder, but in this stage of code I have an error at this row:Bitmap ^ bmpPicture =...
[5 replies] Last: I think the right way to do it is to store the image filenames as a fo... (by Thomas1965)
Template specialization in non-namespace scope
 
Hi. Look at this piece of code. (compiles on MSVC++, doesn't compile on gcc and clang) #include <iostream> using namespace std; template<bool CONDITION, t...
[3 replies] Last: > Seems a pretty strange decision. Who knows... they must have their r... (by JLBorges)
c++ object creation error after constructor
 
Hi, i have a class called A with a constructor. In the main program I have the following code: int main{ A A(10); A obj; ... ... } I ...
[1 reply] : The variable name shadows the type name. // Creates an object of typ... (by Peter87)
Can't access "using" directive from a template struct
 
Hi. I'm making my own std::conditional<> implementation. Look at this simple example: template<typename T> struct S { using theType = T; }; Why can't...
[3 replies] Last: Yes. The name of a nested type is in the scope of its enclosing class. (by JLBorges)
Books
 
Hello all! I plan on buying C++ Primer (5th Edition), and Programming: Principles and Practice Using C++. My question is, would it be a good idea for me to get...
[6 replies] Last: Thanks @Little Captin that's pretty much what I've been trying to get ... (by YvngSavage)
July 2016 Pages: 1... 10111213
  Archived months: [jun2016] [aug2016]

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