General C++ Programming - August 2015 (Page 14)

Depth First Search - Trees & Graphs
 
I have a data structure question. Don't know if this is the right place to put it. Anyways here it goes: I am not understanding why there is a difference in th...
[1 reply] : In case of a graph, we print the node and then go to the next node(ch... (by helios)
C2440 error in BitArray template class
 
Ok so I've spent quite a bit on this and I'm at a loss as to what to do. I've gone over my code and everything looks to be fine. This is currently incomplete. A...
[2 replies] Last: BitArray<> temp1 = slice(n, _count - n); return bitArray <<= sLeft; ... (by MiiNiPaa)
Tip for those interested in programming graphics
 
I've seen more than a few questions from people asking how to get started in programming graphics. The thing about programming graphics is not just knowing how...
[2 replies] Last: It got more interesting. You would need this to run it: https://proce... (by shawnlau)
Smart pointer as member
 
I'm currently making a class that has an optional member (a texture). As textures are very big, I'd be using references or pointers anyway but because it is opt...
[10 replies] Last: You could just modify it to hold shared_ptrs instead of weak_ptrs, wh... (by MiiNiPaa)
bit reverse algorithm
 
I am trying to understand how FFT works in C++, I found a site where it provides source code(http://www.drdobbs.com/cpp/a-simple-and-efficient-fft-implementatio...
[no replies]
need to add namespace to header, other file compilations
 
Recent exercise was to multiple file compile 1) .cpp and another.cpp and 2) .cpp and .h. Both work as long as I have namespace in the dependent file. ex: main...
[5 replies] Last: how to add a .cpp file to another .cpp file You've not learned anyth... (by Duthomhas)
by YowHow
Enum as a type for function?
 
This code enum MenuResult { Nothing, // Enums for game state Exit, // Enums for game state Play, // Enums for game state }; MenuResult Show(s...
[6 replies] Last: I see.. Thanks everyone. also on the c#. Awesome work. Thanks. I a... (by YowHow)
Special types mixing pointers and arrays
 
Hi, I have to call a function in some DLL One parameter for the function is defined as: float (***p) ; It somehow should hold a 4 dimensional array of float...
[3 replies] Last: whooops, thank you! (by Gamer2015)
OMRON D6T
 
Hi there, Im new to C++ Programming and trying following c++ code. #include // I2C communication functions extern void I2C_start(); extern void I2C_re...
[2 replies] Last: I get no errors compiling this in Visual Studio. What compiler are you... (by AbstractionAnon)
by kecik
comparing user input with textfile and for loop
 
Hi. I am trying to compare what user enter with the data in my textfile. However, I am still not able to do any comparison. And on top of that, they will have o...
[5 replies] Last: it's meant to stop, that's why it's called a breakpoint. When it does ... (by mutexe)
Correction of Merge
 
Please can you help me find a errors corrected in this code //Merge Sort #include "iostream" #include <conio.h> #include <stdio.h> using namespac...
[8 replies] Last: Line 16,27: elseif is not valid else and if are separate keywords... (by AbstractionAnon)
suggestion: joining two bitsets
 
It is quite disappointing that C++11 cannot join two bitsets. For example, I am doing Huffman encoding/decoding. I have obtained the code word for every input ...
[2 replies] Last: Bitsets represent fixed sets of bits. If you want a dynamic collect... (by Duthomhas)
Collision Code Help
 
Hi, I was looking for some help in regards to some code that I have written for a replica Pong Game. I have managed to create a border around the game using rec...
[12 replies] Last: Collision objects are a lot simpler than the objects they represent. ... (by Duthomhas)
Please help in C++ programming
 
have the following code that compiles fine as one file, but need to seperate the .cpp files (Item and ShoppingCart) into .cpp and .hpp files. I should end up wi...
[1 reply] : It's quite straight forward, just put your class declarations in a sep... (by ajh32)
arrays
 
#include <iostream> #include <conio.h> #include <cstdlib> using namespace std; int main () { char ans; do { int i, n, sum; int array ; cout << "E...
[4 replies] Last: I think line #69 should read for (int i = 0; i < sizeof(array)/sizeof... (by codewalker)
Their must be a more efficient way of doing this.
 
I'm planning on building an auto trading algorithm, but I'm currently not sure what the best way is to have arrays of a size of roughly 50 continually updating ...
[2 replies] Last: You could make a map of arrays or vectors. #include <iostream> #incl... (by Gamer2015)
anyone can u answer this
 
c++program that accepts five numbers from the user and DISPLAYS the highest and the lowest number.
[4 replies] Last: Here are tutorials, I don't know how far you are but the first part, "... (by Gamer2015)
Problem with SDL
 
So i'm trying to build this code #include <iostream> #include <SDL\SDL.h> int main() { if (SDL_Init(SDL_INIT_VIDEO) < 0) { std::cout << "SDL init faile...
[1 reply] : Where are your .lib files located? Make sure they are located where Vi... (by Peter87)
Getting data from sensors/switches without a library?
 
Hi everyone! I'm Krish, brand new to the forums. So...I have a little experience with using switches and what not, but in all the cases I have done so I had a l...
[3 replies] Last: C++ doesn't know anything about any devices on the computer. For all i... (by LB)
August 2015 Pages: 1... 121314151617
  Archived months: [jul2015] [sep2015]

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