General C++ Programming - July 2011 (Page 9)

by jpotts
Problem with functions
 
Hey, I am using a function in a code, but i want to use it multiple time. However my problem is that it returns the same value for each thing i use it for... ...
[5 replies] Last: Read up on pseudo random number generation. rand returns numbers in a ... (by hamsterman)
significance
 
Hi, I have seen in many of open source codes the do-while(0). Can anybody let me know when this is useful and whats the significance of constructing such cod...
[7 replies] Last: It is also very useful in macro expansions... (by Duthomhas)
Snake game - great for beginners
 
This is the first game I have made and I learned many things. I am posting this to give other beginners ideas and inspiration. Enjoy. p.s. If you find any ...
[8 replies] Last: Newest version posted. Are my loops and keyboard input methods effi... (by closed account zwA4jE8b)
Problem with pointers
 
Hi I have no idea how to check if an object gets more pointers attached to the same object. I am gonna make an image class which will hold a pointer to SD...
[1 reply] : What you need is exactly a boost::shared_ptr. shared_ptr is a referen... (by jsmith)
Could not convert 'line.std...' to bool
 
Hi guys, I'm quite new to C++ programming. I was trying to write a simple c++ to delete line from a text file but got some errors. Any help will be appreci...
[4 replies] Last: Hi hamsterman, Thanks! That seems to have worked. I will continue to ... (by sgarthur)
by HenriK
Method Chaining - what & how?
 
Hi, it´s me here, this time trying to deal with XInput . I found handy, perfectly working tutorial how to configure Xbox 360 -controller into your applicati...
[1 reply] : http://www.parashift.com/c++-faq-lite/references.html#faq-8.4 (by closed account DSLq5Di1)
Please help. I really have no idea how to code this.
 
Program Assignment Write a program that rolls a set of dice 2500 times and computes: 1- the number of games won and the number of rolls taken before the win, ...
[5 replies] Last: This is what i have so far. its a bit messy and its not even close to ... (by jftm2000)
Can you please Fix this Code of C++ language? its very simple, but i just started to learn programming?
 
I wrote this code to get the Area of circle, but i don't know whats wrong with it, that i got many errors. Can you please fix these errors, and write me in deta...
[7 replies] Last: @rambo1177: Turbo C++ is extremely outdated. I must use it because it ... (by Nisheeth)
Threads
 
Hello, I hope this is where i should post this doubt... In my college course the c++ class i took worked only with Microsoft Windows and Microsoft W...
[2 replies] Last: I recommend Boost threading library. Its portable and the next version... (by Galik)
by line
printing out string from integer
 
I have a struct Time: struct Time { int hours; int minutes; Time(int hrs = 0, int mins = 0){ hours=hrs; minutes=mins; } }; What i'...
[3 replies] Last: <ctime> isn't a library. It's the C++ header that encapsulates the C ... (by PanGalactic)
by jpotts
Dice roller
 
Hi, I have made a simple dice roller, however each time i run the code it always comes up with the same number, how do i avoid this? The code is: #inclu...
[3 replies] Last: Anything that changes frequently and (preferably) doesn't often repeat... (by Athar)
Graphical problem
 
when i am trying to use getimage() in turboc3 it changes the white color in yellow
[1 reply] : What subsystem are you using it on? Chances are you are dealing with a... (by Duthomhas)
by rain
is it possible to pass any var type to func?
 
Is it possible to make function that would accept any type of variable and then auto convert it to string? There seems to be so many problems with variable t...
[5 replies] Last: There are rules to how the compiler assignes types to literal values. ... (by Duthomhas)
Making a Game Engine (1,2)
 
Say one wanted to make a game engine, like a doom game engine, the whole game being no larger than 13 megabytes. How long would that take? Just one person wr...
[20 replies] Last: [quote=naf456]stop discouraging them for god sake! you can pretty ... (by Disch)
variable name in variable declaration
 
Hi, I have a program which creates variable amounts of data in arrays of linked lists (up to 12GB or so) and then dumps it to file. Since I cannot hold...
[2 replies] Last: I wish i could do an appended output. I have to append line by line i... (by pzratnog)
palindrome (1,2)
 
I'm working on an assignment to find the largest palindrome that is the product of 2 three-digit numbers. So the factors could be anything from 100 to 999 and t...
[21 replies] Last: reverse http://www.cplusplus.com/forum/beginner/47260/#msg256584 vari... (by ne555)
Please explain this output
 
#include <string> #include <iostream> using namespace std; class AAString { public: AAString() { cout << "AAString()" << endl; ...
[17 replies] Last: *ahem* [quote=I in my first reply] This doesn't create an object. It... (by Disch)
by h9uest
Come in if you like programming AND math
 
Hi all: My cousin, who is a high school student receiving programming training on his school team, showed me what they did for training. I was impressed, and f...
[8 replies] Last: @kev82 & ne555: Thank you for the inputs! They're helpful :) (by h9uest)
by Bhuggy
File formatting.
 
I'm experimenting with writing to files and I've created a loop that simple continues to accept user input until a key word is used then it ends the loops and t...
[3 replies] Last: Thank-you both, Modshop for the nice fix. and Catfish for the good in... (by Bhuggy)
what is the token between class and class-name
 
Example: class _OgreExport DataStream : public StreamAlloc Trying to find out what '_OgreExport' is/does in this case.
[1 reply] : It must be a macro for when ogre is used as a DLL, set to declspec(dl... (by bartoli)
July 2011 Pages: 1... 7891011... 30
  Archived months: [jun2011] [aug2011]

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