
please wait
by atakanarikan
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 after multiplying all the weights with -1 and run the program i... |
Dec 30, 2013 at 12:31am
[2 replies] Last: Adjacency list is your best option in this case http://en.wikipedia.o... (by Smac89)
|
by CodeONE
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 situation is , I have a ball which should move on a flat horizontal ... |
Dec 30, 2013 at 12:19am
[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 seed the vector but I cant figure out how to keep from repe... |
Dec 29, 2013 at 11:56pm
[3 replies] Last: Thank you Luke and Cubbi. I have only taken C++ 1 in school and am tak... (by OUIJ)
|
by johnmerlino
Why can't unary operator & be applied to constants?
|
I came across this: "The & operator only applies to objects in memory: variables and array elements. It cannot be applied to expressions, constants, or regis... |
Dec 29, 2013 at 11:00pm
[1 reply] : Whoever wrote the sentence, mixed up quite a few concepts. What they p... (by Cubbi)
|
by TsarLenin
Friend functions and classes not permitted to data
|
I have a situation: I have a class character class Character; class Village; class Character { public: //Functions void charGen(); //... |
Dec 29, 2013 at 10:43pm
[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... autoit with a GUI and QT it's not this. Case $BTN_GetU... |
Dec 29, 2013 at 10:33pm
[no replies]
|
by johnmerlino
pitfalls of macro substitution
|
"If you examine the expansion of max, you will notice some pitfalls. The expressions are evaluated twice; this is bad if they involve side effects like incremen... |
Dec 29, 2013 at 7:53pm
[1 reply] : Macros are textual substitution, they're basically a copy-paste mechan... (by Catfish666)
|
by isaacaf
Xorshift RNG
|
I tried to use the following code to generate random numbers but it always show me errors first is that t is not declared in this scope #include <iostream> ... |
Dec 29, 2013 at 7:26pm
[1 reply] : [code firstline=7]unsigned long xorshf96(void) //period 2^96... (by long double main)
|
by johnmerlino
sort algorithm
|
In the below sort algorithm, let's say left is 0 and right is 9 and v is an unsorted integer array from 0 to 9. At one part is sets left (0) to last. Then it se... |
Dec 29, 2013 at 6:39pm
[no replies]
|
by beinando
Quaternions for rotating Vectors
|
Hey C++ Community, i got a problem here, i try to use quaternions to rotate one(and later more!) 3d-vectors in a general manner. i read in wikipedia, tha... |
Dec 29, 2013 at 6:15pm
[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 modes ( ios::app , ios::ate , ios::binary , ios::trunc , ... |
Dec 29, 2013 at 5:58pm
[20 replies] Last: Yeah, you are right but keep in mind it's not a real program and also ... (by Kubani)
|
by atakanarikan
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; adjMatrix= new int* ; for(int i=0; i<numOfVertices; i++){ ad... |
Dec 29, 2013 at 5:46pm
[1 reply] : You can tell new to initialize the values to zero by putting a pair... (by Cubbi)
|
by benbalach
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. The main thing I learned for my first book on C++ is that a ... |
Dec 29, 2013 at 2:25pm
[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() { std::ofstream YourFileName; std::string TxtIn; ... |
Dec 29, 2013 at 1:31pm
[6 replies] Last: Edit: how can i print this > void main_2() { std::string Coutnam... (by VinKol)
|
by Vasuman
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 beginner at programming; I have been working with C++ for o... |
Dec 29, 2013 at 9:21am
[5 replies] Last: Hello, What was he smoking when he gave the assignment? Or you whe... (by Largins7)
|
by IWishIKnew
Msys install not working
|
When I install msys, I get the following error: :\msys\1.0\bin\sh.exe: *** Couldn't reserve space for cygwin's heap (0x1470000 0x1580000>) in child, Win3... |
Dec 29, 2013 at 3:56am
[3 replies] Last: I don't have Cygwin. I should have specified that. Also, it is worki... (by IWishIKnew)
|
by almostcash
C++ Help Needed
|
How do you randomly select a uniform value from a range of numbers? |
Dec 28, 2013 at 11:34pm
[1 reply] : #include <random> #include <chrono> #include <vector> #include <iost... (by TwilightSpectre)
|
by johnmerlino
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 return value will still be a double. #include <ctype.h> ... |
Dec 28, 2013 at 11:21pm
[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 functions. I just wrote the first two functions and I need your h... |
Dec 28, 2013 at 10:28pm
[15 replies] Last: i didn't ignore your advice but it was not the complete coding ... i w... (by chry44)
|
by eman2013
Opengl
|
Does anyone know how to get opengl working in code blocks? I have tried putting in the libraries and such in the correct folder. But I get an error saying that ... |
Dec 28, 2013 at 8:54pm
[1 reply] : http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/ (by Chriscpp)
|