General C++ Programming - March 2017 (Page 3)

Metaprogramming text book recs
 
Can anyone recommend a good text book or totorial to learn template MetaProgramming. I have about 2 years experience with c++ and a solid understanding of the b...
[1 reply] : Alexandrescu: Modern C++ Design http://www.amazon.com/Modern-Design-G... (by JLBorges)
What's wrong with my hill climbing? (salesman problem)
 
Hello, I have decided to try and solve one of the most common problems, that is the travelling salesman problem. For some reason my algorithm is not giving me t...
[1 reply] : The problem is Swap(cities, i, i++); , for two reasons. 1. i is mo... (by Peter87)
Comparing elements in map to each other
 
My task is to find the node that is closest to the specified node in distance, but I am unsure how to compare elements in a map to each other to do the followin...
[4 replies] Last: // return std::min_element(nodes.begin(), nodes.end(), cmp); return s... (by JLBorges)
Changing code with array
 
How do I use array in this code? REWRITE THIS CODE USING ARRAY #include <iostream> #include <iomanip> using namespace std; // Function Prototype doubl...
[2 replies] Last: REWRITE THIS CODE USING ARRAY ok, let's ask ourselves first - which ... (by gunnerfunner)
by cmisip
Returning from SIGIO handler prevents future SIGIO handling
 
I am trying to read from a serial port only when there is data available. I used fcntl to attach a SIGIO signal to the deviceDescriptor. It works. Pressing the...
[6 replies] Last: I was able to get rid of the segfault. The solution was to use sigpro... (by cmisip)
c++ world series winners
 
#include<iostream> #include<string> #include<fstream> using namespace std; int main() { cout << "\nWorld Series Champios"; cout << "-----------------...
[2 replies] Last: Line 46 implies worldSeries.txt has data for 109 years. Your array on... (by AbstractionAnon)
by Kalcor
Recursion permutations
 
Aargh, I really need a way to know how to use recursion functions to permute abcd for example e.e I just can't seem to find an understandable way
[4 replies] Last: I was just using abcd as an example. The algorithm will work with any... (by dhayden)
Create a program that calculates the next syzygy of four planets?
 
Create a program that calculates the next syzygy of four planets: Assumption: Orbits are circular Input: text file provided detailing planet, Orbitalradius, O...
[2 replies] Last: Thanx very much sir,,,! You are awesome. There were days I loved p... (by imran9337426)
File to Map with structs
 
Currently trying to figure out how to read data from a file, line by line (getline) which be placed in a new Node which is initlized according to the Node con...
[2 replies] Last: That worked and makes sense, thanks! (by PirateCat)
In need of help with overloading operators for use in Polynomial Class
 
I am trying to write a program that can add, subtract, multiply polynomials. It needs to work with both two polynomials and a constant and a polynomial.I need h...
[3 replies] Last: Lines 21 & 22: Shouldn't the data be private? Line 63 allocates the n... (by dhayden)
Determine dimensionality structure of a vector of vectors of ...
 
Hello People, I want to write a template which I can pass to an undetermined -in advance- nested structure vector, that is: vecto<vector<vector<...>>> ...
[7 replies] Last: I suppose the code check conditions from left to right in the run in ... (by dariodem)
by sed2
Problem with sendinput
 
I need to simulate UP arrow key, so i used sendinput, i saw on https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx UP arrow key is 0...
[no replies]
PPP2 Chapter 12 Exercise 1
 
I need to draw two rectangles. One as a Rectangle ( Rectangle class) and the other as a Polygon . I drew them, but I had to do trial and error as I wasn't...
[12 replies] Last: Oh, okay, thanks. (by DragonOsman)
by sed2
Why the mouse is moving on the lower right?
 
This is my code: #define WINVER 0x0500 #include <windows.h> void MouseMove (int x, int y ) { double fScreenWidth = :...
[2 replies] Last: MOUSEEVENTF_ABSOLUTE 0x8000 The dx and dy members contain nor... (by integralfx)
PPP2 Chapter 11 Exercise 13
 
Okay, here's another one. Reading a text file and then writing out the words in reverse order. I'm having trouble printing out the words in reverse order. Ho...
[13 replies] Last: You think you could come over to the thread I made for Chapter 12 Exe... (by gunnerfunner)
Random Number Generator Addition Problem.
 
Hello everyone, First time post here so I hope I'm not breaking any rules. This assignment is a combination of loops and random number generators. Unfortunatel...
[1 reply] : I'd just like to let everyone know that I figured it out. I took a sum... (by LordBozo)
Writing a basic game in C++ - Need advice!
 
Hello guys, I am writing a "reversi" game, and I want to know what ways do you guys recommend to check for the legal and illegal moves for black dots ? So far...
[3 replies] Last: ok, well same logic, just 4 more checks, 8 instead of 4, each a loop o... (by jonnin)
Uncertainty calculator program in c++
 
Hi, this is the first time I write in this forum. I i'm a beginner in c++ but I was wondering if it is possible to write a program that calculates errors ...
[1 reply] : Yes, it is possible to program an 'equation parser' in C++. There are ... (by closed account 48T7M4Gy)
UNDEFINED REFERENCE TO CLASS - SOLVED
 
Hello everyone, I am not sure if this is the right section for my question. I'm sure you've seen a million questions like mine, but unfortunately I have the fo...
[3 replies] Last: Hello everyone! I think to understand why I had this problem. I am usi... (by s222571)
c++ programming
 
hello, i need help in the following c++ programming question please 4 Cinema 4 This program is for a cinema. It computes the price of a movie ticket. It offe...
[2 replies] Last: From the assignment : There are four type of seats. There is one price... (by Mantorr22)
March 2017 Pages: 12345... 19
  Archived months: [feb2017] [apr2017]

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