General C++ Programming - July 2014 (Page 18)

by CVK
solution to a practical problem
 
Hello everyone, I need a solution to a practical problem. My need is that i need to design a program for a machine. The machine takes "x"qty of load, refines...
[1 reply] : after how many times, does the qty of the load refined will be equal ... (by Computergeek01)
by twesna
Dice Rolling Program Help
 
I've been having problems with my program. When I go to compile the program and enter a number to roll the dice the data given is wrong. For instance if I roll ...
[5 replies] Last: You can also make this a lot easier using arrays: int counts = {0}; ... (by dhayden)
Please help to correct my program
 
#include<iostream> #include<cmath> #include<cstdlib> using namespace std; int main() { int binary; int rem; int MyEnd; int i; ...
[11 replies] Last: ^ is the bitwise exclusive or (XOR) operator, not an exponentiation op... (by AbstractionAnon)
If statements not working properly.
 
Now it's been almost a year since I was last doing programming, plus my already beginner level skills leaves me at a low point here. But I'm pretty sure if stat...
[3 replies] Last: Setting the expressions equal to something. At the risk of sounding... (by Chervil)
A little help with matrix multiplication
 
I've been assigned to build a program which completes mathematical operations using matrices. I have to use dynamically allocated 2d arrays, and can only use * ...
[1 reply] : The elements of the matrix has not been initialized. (by Peter87)
Functions terms
 
I'm little confuse about these three terms: 1.interface to functions 2. function declarations 3. implementation of the functions An example with comments ...
[4 replies] Last: The link I gave has a section titled "declaring functions". Was that ... (by keskiverto)
shared_ptr undefined reference
 
i am working on my Game Engine and i am getting several undefined reference errors with my code. It will probably be easier if you see the code. Game.h #if...
[8 replies] Last: i was able to fix the problem by studying the code i am learning from (by Cronnoc)
by Niven
Help implementing AlphaBeta
 
Using the follow pseudocode as a basis, I wrote a class for performing minimax with the alphabeta algorithm: function alphabeta(node, depth, α, β, m...
[no replies]
by tcb
Populating Arrays with info from .txt file using a fuction
 
So I am given three .txt files, one with names, and the other two with before and after weights (integers) and I am supposed to create 3 arrays (each of size 10...
[no replies]
Structure Alignment Question
 
Hello, The C11 and C++11 standards include alignment-specifiers using '_Alignas()' and 'alignas()', respectively. The standards also say alignment-specifiers...
[3 replies] Last: The default alignment is implementation dependent and is normally sele... (by dhayden)
by chhe
maximizing efficiency
 
I've written a program that compares two vectors A and B to see at which locations A equals B. The problem is that the program is prohibitively time consuming w...
[6 replies] Last: Don't use vectors. Copy the elements of a into a set. Then for each... (by dhayden)
Using a "pipe" for data flow
 
Hi, I am trying to continuously write 32 bit samples to a "pipe" and then read the data to a file. I have seen many examples on creating pipes in c but am s...
[no replies]
Measuring time difference efficently?
 
I have accomplished this but it looks hacky if you ask me time_t timeToNextFeed() { Leaf::Record* r = records->getRecord(0); if (r != NULL) ...
[2 replies] Last: That's about it, but I have some comments. Why is timeToNxtFeed a d... (by dhayden)
by Aaveg
Clear screen function
 
What should be used in c++ for clrscr()? as we us in c When I put clrscr(); after variable declaration in program it is showing error and error is that functio...
[7 replies] Last: i am aware. that doesnt mean you dont need to. im also not required to... (by Little Bobby Tables)
Need advice on how best to structure an engine
 
So I am currently writing a game engine using SFML for graphics. The program compiles and works fine on linux using g++, but doesnt compile properly on MSVC++ 2...
[3 replies] Last: So this would be handy if I wanted to go to some game object & set a ... (by helios)
WHY POW CANNOT BE DECLARED
 
#include<iostream> #include<cmath> #include<cstdlib> #include<string> using namespace std; int main() { unsigned int binary; unsigned int rem; uns...
[1 reply] : Please do not post the same problem multiple times. http://www.cplusp... (by AbstractionAnon)
what's the point of NULL in cstring
 
hello. I dont see any point of NULL in cstring. The code given below just outputs same as it would have done with NULL. My understanding is if size of char arra...
[1 reply] : I guess you mean the null character '\0'. The null character is needed... (by Peter87)
Sound Effects for Games
 
Hello there, I would like someone to point out a good sound library for windows. I am using it in a game, and I have checked out the PlaySound function from t...
[2 replies] Last: Thanks, and for anyone else reading this I actually came to the decisi... (by Irrelevant Elephant)
Finding a value in a 2D array?
 
Hi! I want to search a 2D array to see if it contains a certain value x . I can come up with three different ways to do this. Provided I have: const int...
[1 reply] : They would all be fairly similar in terms of performance. Solution 1 a... (by TwilightSpectre)
SMTP error with data command
 
Hello :) I work currently on the program and I need send a mail. I have a problem with a data SMTP command. Indeed, this command return this error message: ...
[11 replies] Last: Solve :D The problem was that I store the mails data in one cell inst... (by blabla32)
July 2014 Pages: 1... 1617181920... 26
  Archived months: [jun2014] [aug2014]

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