General C++ Programming - December 2013 (Page 3)

Finding the longest path in a graph
 
I was asked to find the longest path in a graph. I was thinking about using Dijsktra's algorithm aft...
[2 replies] Last: Adjacency list is your best option in this case http://en.wikipedia.o... (by Smac89)
How to move a ball continuously in 2D scrolling game ?
 
Hello people, I have just started with learning how to make basic games in c++. The situatio...
[7 replies] Last: ball.pos.x = background.center.x; Why did I use background.center ... (by Smac89)
by OUIJ
seedin a vector with 52 unique values
 
I am trying to seed a vector with 52 values ranging from 1 to 52. I already have the code written to...
[3 replies] Last: Thank you Luke and Cubbi. I have only taken C++ 1 in school and am tak... (by OUIJ)
Why can't unary operator & be applied to constants?
 
I came across this: "The & operator only applies to objects in memory: variables and array elemen...
[1 reply] : Whoever wrote the sentence, mixed up quite a few concepts. What they p... (by Cubbi)
Friend functions and classes not permitted to data
 
I have a situation: I have a class character class Character; class Village; class Charac...
[4 replies] Last: Thanks! I will try these solutions! (by TsarLenin)
by djnewg
language autoit to C++ ???
 
hello, I'm big problème i have old program and i'm new QT for create a new appl. Juste cause.....
[no replies]
pitfalls of macro substitution
 
"If you examine the expansion of max, you will notice some pitfalls. The expressions are evaluated t...
[1 reply] : Macros are textual substitution, they're basically a copy-paste mechan... (by Catfish666)
Xorshift RNG
 
I tried to use the following code to generate random numbers but it always show me errors first is t...
[1 reply] : [code firstline=7]unsigned long xorshf96(void) //period 2^96... (by long double main)
sort algorithm
 
In the below sort algorithm, let's say left is 0 and right is 9 and v is an unsorted integer array f...
[no replies]
Quaternions for rotating Vectors
 
Hey C++ Community, i got a problem here, i try to use quaternions to rotate one(and later more!) ...
[7 replies] Last: I don't know if there is a simpler way, but you could take one of the ... (by ne555)
by Kubani
How to reverse a text file (1,2)
 
If we have a text file containing the string: abc , how to reverse it to be cba using file open m...
[20 replies] Last: Yeah, you are right but keep in mind it's not a real program and also ... (by Kubani)
Initializing a 2d dynamic array with all entries 0
 
is it possible to create a dynamic array with all entries in it equal to 0? int** adjMatrix; adjM...
[1 reply] : You can tell new to initialize the values to zero by putting a pair... (by Cubbi)
I (almost) finished my first book on programming, now what?
 
I'm on the last chapter of "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup. ...
[7 replies] Last: Thank you, This belongs more in the lounge, but By the way, Tim O'... (by Largins7)
by VinKol
C++ write to file, save as..?
 
Hello everyone! i just made this ---> #include <iostream> #include <fstream> int main() { ...
[6 replies] Last: Edit: how can i print this > void main_2() { std::string Coutnam... (by VinKol)
Object Oriented Program (OOP)
 
Hi everyone. This is my first post in the Cplusplus website, so I apologize if I mess up. I'm a...
[5 replies] Last: Hello, What was he smoking when he gave the assignment? Or you whe... (by Largins7)
Msys install not working
 
When I install msys, I get the following error: :\msys\1.0\bin\sh.exe: *** Couldn't reserve sp...
[3 replies] Last: I don't have Cygwin. I should have specified that. Also, it is worki... (by IWishIKnew)
C++ Help Needed
 
How do you randomly select a uniform value from a range of numbers?
[1 reply] : #include <random> #include <chrono> #include <vector> #include <iost... (by TwilightSpectre)
convert string to double
 
In the below function, it muliplies "10.0 * val". Why does it use 10.0? If you remove the 10.0, the ...
[1 reply] : I guess is it could slightly be for efficiency (though some of the oth... (by TwilightSpectre)
by chry44
C++ help!
 
hello guys! i am new in here...I have a C++ homework assignment that wants me to create three functi...
[15 replies] Last: i didn't ignore your advice but it was not the complete coding ... i w... (by chry44)
Opengl
 
Does anyone know how to get opengl working in code blocks? I have tried putting in the libraries and...
[1 reply] : http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/ (by Chriscpp)
December 2013 Pages: 12345... 37
  Archived months: [nov2013] [jan2014]

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