Beginners - March 2009 (Page 9)

Random number generator
 
I'm working on a DnD game and I need to know how to make a random number generator, say 1 to 50 for ...
[1 reply] : Use srand() ONCE to seed it, then call rand() for a random int. You c... (by firedraco)
errors with assert()
 
We are writing our own string class(mystring), and I am having a problem with my operator overload....
[2 replies] Last: duh! That's why I love this site. I had looked at it for too long wit... (by grcunning)
by berge
getArea() function
 
Hi! I have a class named Rectangle with the private members: double width; double height; I hav...
[4 replies] Last: I see! thanks! are there any rules for when I should use this->width, ... (by berge)
how to solve this task
 
WAP that allows the user to enter numbers till the user wants and at the end it displays the number ...
[2 replies] Last: Thank U!!! i have made the correction and now the code is working. (by blue cloud)
how can my program identify if input is a double or a int?
 
i want my program to accept ONLY double value and if the user put in a int the program dont accept i...
[1 reply] : if you're querying the user for input, and want that input to be store... (by jRaskell)
Deleting Pointers
 
Hi do i need to delete the pointer. void test(){ char* pChar; pChar = new char ; ...
[3 replies] Last: It is not automatically deleted. You have to delete it. Generally ... (by jRaskell)
by newb17
problem tryin to read from file
 
im trying to read some info from a file but im getting this compiler error In member function ‘...
[2 replies] Last: arr such a simple mistake. thanks (by newb17)
by jesusk
i cant find out the problem
 
this program is supposed to work with functions outside the main function ok? so ur asked for a pro...
[3 replies] Last: yeah i've noticed when i checked every function individually and the... (by jesusk)
List Files
 
Hi what function i need to use if i want to list all files in a directory. tnx
[1 reply] : There's no such function in the standard library. Either a) use syste... (by helios)
Illegal use of pointer function
 
I'm attempting to do a simple output where the int variable "creaturelevel" is shown to the user, bu...
[1 reply] : Line 16: You're doing cout < instead of cout << . Line 27: Don't d... (by helios)
what wrong with my program.why it is cannot run?
 
#include <iostream.h> #include <iomanip> const float TAX=.06; void menu(); int main() { ...
[1 reply] : Well, I see multiple places where you would get an error. Is it giving... (by closed account S6k9GNh0)
Input tags separator
 
I've written the following loop that stores each line of a file into the row of a 2D array, item by ...
[3 replies] Last: Not a problem...the worst people are those who go: "OMG HW PROBLEM!... (by firedraco)
by jaydr
clearing screen
 
I have read the following already before anyone gets on me. http://www.cplusplus.com/forum/beginne...
[2 replies] Last: i figured that out but i would like to do it right instead of the the... (by jaydr)
by Oromis
Create an empthy surface in SDL
 
How can I create an empthy surface in SDL? Is something like the following possible? SDL_Surfa...
[1 reply] : See a reply to your other post on same subject. (by guestgulkan)
by wretch
comma operator: dangerous or useful?
 
Has anyone ever used the comma operator in their programs? i1 = (i2 = 2, i3 = 3); I mean...
[6 replies] Last: In general the operator is useful only in very specific circumstances ... (by jsmith)
Converting int to string C++
 
Hey, I need to write a code in my program to convert int to string like 1 will be USA 2 wi...
[5 replies] Last: Yes, I meant n-1 so that if n==1 is returned n (the 1 st element)... (by Bazzy)
how to solve this task!!!!!plz....
 
How to do this assigment.im did not understand it..plz somebody help me.i will appriciate anybody wh...
[1 reply] : Start with this: #include <iostream> int main() { std:... (by kempofighter)
by sobi
Menu-driven program in C
 
This is a menu driven program that allows a user to enter five numbers and then choose between findi...
[1 reply] : I'd love to help you but here are the problems. 1) you didn't use c... (by kempofighter)
how to solve this task
 
Write and exercise a program that allows the user to compute the number of days that elapse betwee...
[1 reply] : start with this #include <iostream> int main() { std::co... (by kempofighter)
Need explaining
 
#include <iostream> #include <cstdlib> #include <cstring> using namespace std; void salaryf...
[6 replies] Last: Hmm well the right numbers are being outputted now but the "Current Sa... (by mcleano)
March 2009 Pages: 1... 7891011... 29
  Archived months: [feb2009] [apr2009]

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