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

for disch - Snake beta - graphical
 
Here is the graphic version. beta obviously just remove line 6 and 32 if you want to compile and test snakemain.cpp /////////////////////////////////...
[1 reply] : snakengine.h //Snake object header #ifndef H_snakengine #define ... (by closed account zwA4jE8b)
Rounding a value up or down in DOS promt C++
 
I am trying to write a simple payroll program however I am having trouble with the values not rounding properly. Please help. #include <iostream> #includ...
[1 reply] : You should implement these as functions: float val = 0.00; float ... (by shacktar)
Passing value by reference in C and C++
 
Passing a reference in C: void foo(int * a) { ... *a=1; ... } int main() { int a; foo(&a); } Passing a reference in C++ void foo(int & a) { ... a=...
[13 replies] Last: Why settle for typing more shit when you can simplify it. If you're... (by shacktar)
Best way to format a tm struct?
 
Hi all I've got a time/date in the form of a tm struct and was wondering what's the best way to format it into a string of the format "MM/DD/YYYY HH:MM:SS". ...
[4 replies] Last: %02d for example, says to format an int (d) into a field width of e... (by jsmith)
Write a C++ class called Song to represent a song in a music collection
 
Hello! This is my first post. Can any one help me with this problem. Write a C++ class called Song to represent a song in a music collection. The data memb...
[7 replies] Last: Sorry, I was mainly looking at the function definitions so it didn't s... (by andywestken)
by chulio
rand distribution
 
Hello, What kind of distribution rand() function has ? Sorry if the question is stupid. Thanks.
[4 replies] Last: boost::random http://www.boost.org/doc/libs/1_47_0/doc/html/boost_ran... (by R0mai)
Am I too late to learn C++ programming? (1,2)
 
I'm 18 and I do not know much regarding C++ programming. Am I actually too late to learn C++? I'm quite interested into it but I do not know where to start. I h...
[20 replies] Last: Its never too late to learn (by wtf154)
by wtf154
Clear Screen?
 
I was wondering how i could clear the screen with out using the System() function. Could anyone help me?
[2 replies] Last: Thank you for your help :) (by wtf154)
message handling problem for game
 
I would like my MessageProc() to be similar to how it is now but the only way I know how to change members of a snake obj is to make it global. (line 19) I wan...
[1 reply] : and for those of you that want to compile and try it here is snakeobj.... (by closed account zwA4jE8b)
by h9uest
libcurl: post data and then get new page data
 
Hi all: I'm trying to interact with a web page with my program. The situation is: There are two pages: page1.php and page2.php In page1.php, there are s...
[1 reply] : Hi All: I've solved all three problems. In case anyone is interested:... (by h9uest)
end of first aera
 
I have made change in my life last summer holiday, I started programming in Pascal. Next change was I changed language to C++. Now it`s the true time to make ...
[12 replies] Last: C# is perfect for GUI development. It seems as though Microsoft are pu... (by closed account zb0S216C)
Algorithm to process all permutions
 
I think it's strange I have to ask this, because I should know this, but I need an algorithm that will process all the permutations for a set of 6 unique symbol...
[11 replies] Last: Dammit! I thought about it some more and my idea that makes that more ... (by PengiunLust)
Tic Tac Toe Program help
 
I do not get why every time this code prints two enter box : enter box: two time after the first loop. It has something to do with the cin.get but I am not sur...
[4 replies] Last: treepig why did you remove the source code? One of the best parts of t... (by ceruleus)
Contacting PHP
 
*****************************
[5 replies] Last: Oh man, I'm having a very similar problem! See my link: http://www.cpl... (by h9uest)
Question Generic Sorting Function
 
How can we write a generic sorting function, that sorts the input ir-respective of its type. i.e it sorts a array be it character array, or array of integers...
[2 replies] Last: You would write a template function or just use std::sort() [ http://... (by closed account 1vRz3TCk)
by asr245
Question on macros
 
Hi, I came across this piece of code which used macro in a way I have never seen/couldn't understand. I tried googling but couldn't find anything like this. ...
[5 replies] Last: Ahh! Thanks. That helps a lot. (by asr245)
operator <
 
hi my friend ok as you know in header file string declare template<class _Elem, class _Traits, class _Alloc> inline bool __CLRCALL_OR_CDECL operator<( c...
[2 replies] Last: tnx a lot my friend you are too profassional :)) (by ahura24)
Array [Help]
 
I am having trouble with storing numbers into my array board . It only prints spaces and | lines instead of the numbers i stored in them. And is there anyway ...
[1 reply] : I would simplify DisplayBoard to just display the board when ever call... (by Azagaros)
Separating words within a string
 
I need to separate words in a sentence(string), and return the individual words. Here is the code I have so far, it reads a line from main and separates the lin...
[10 replies] Last: I was wrong when it came to the 2. paramter of 'find()'. Here's the wo... (by coder777)
Ristricting function calls in C
 
Suppose I have a structure S containing a function pointer. Now we want this function to be called only by the structure containing pointer only.Not from main d...
[8 replies] Last: Sorry about not replying sooner, I can't post code samples from my cur... (by kbw)
July 2011 Pages: 1234... 30
  Archived months: [jun2011] [aug2011]

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