Beginners - April 2011 (Page 24)

rand() and srand() ques.
 
For my text game, my battle function looks like this: int Battle(){ int userDamage; int monsterDamage; int userHealth; int monsterHealth; srand ...
[2 replies] Last: Oh, I see now, thank you! I'll pop those in and see how it works. (by Cptsmith1)
by mobat
Array map check etc.
 
So far I have: character.xCoord = 5; character.yCoord = 5; char text; while (1 == 1) { cin >> text; switch(text) { ...
[7 replies] Last: Alright, try this: #include <conio.h> //Used for getch(); cha... (by b1gb0y2013)
average grade
 
Hi, How to calculate the average of letters (grades) ?
[2 replies] Last: Well, I think it would be better to calculate the average as a percent... (by Browni3141)
Vector subscript out of range - instantiation error.
 
Hi there, I'm trying to initialize a class with a 2D matrix subclass. I've been trying to use a double vector (vector< vector<Cell>> maze_cell) and then acce...
[3 replies] Last: I see how push_back(...) works - however, with the 2d array i'd rather... (by NickTurner)
Multiple Variable Assignments with cin.
 
I am trying to do this with a program using overloaded function names. The last time I tried this, it gave my a uninitialized local variable error Basically, w...
[2 replies] Last: Thank you. (by DivinFalcon)
read from input file name !! :/
 
hi, How to read from a file when user is asked to enter the file name for example, the program will prompt enter filename you wish to see, and user e...
[10 replies] Last: thanks :> (by Thuraya)
Printing vector problem.
 
this is a part of my program. it seems tha in my printing function vprint has a problem class Scedule { vector<Appointment> m_apps; public: voi...
[6 replies] Last: thank you. I'll try to fix it! (by irinaki)
by Billst
Help with classes or functions
 
Hi I am currently studying C++ for fun and as a side track am developing a simple text only rpg based loosely on the hobbit mainly for my brother my reasons...
[1 reply] : Firstly, it's [co de][/c ode] tags here. Then, see http://www.cplus... (by hamsterman)
Deleting a File record
 
HI i want to delete some records from a binary file without creating a new file. please suggest me some way to do it as i m new to file handling. Thanks in...
[4 replies] Last: Step 1: Read file into memory. Step 2: Find and destroy desired dat... (by Computergeek01)
C++ Code gives wrong answers (1,2)
 
free
[27 replies] Last: If I post something in the Beginners Forum, I would expect that those ... (by irishme)
read file in 3d array of character
 
hi every one i have to do that home work for c++, but i have no idea how can i do that, plz someone help me.. Input: A file (“bigList.txt”) conta...
[no replies]
by jjzpgg
Unhandled Exception error implementing sprite
 
Hi all, So I'm new to C++ and it was all going swimmingly until I hit a wall. I'm learning C++ in the context of making games, and for my project I'm ma...
[6 replies] Last: I've managed to fix it. Turns out my game folder was a complete mess a... (by jjzpgg)
Help me improve this code
 
Can Someone suggest how I can improve this code and where I need to improve this? #include<fstream.h> #include<string.h> #include<conio.h> #include<...
[no replies]
by Tabby
trouble seeing finished product
 
Hello, I am having trouble seeing my finished product. Basically, I run the program and at the very last line of code, it executes, and then the screen dis...
[2 replies] Last: If you use Code::Blocks, it will keep the output window open at the en... (by mobat)
by Sieves
pointers as parameters and arguements
 
I'm trying to pass a dynamic array into a function and fill it but i can't figure out how to do it correctly and i can't find any good literature on it either.....
[4 replies] Last: I feel like that is terribly inefficient but limited from vectors as i... (by Sieves)
A simple guessing game C++
 
I have this problem where there are two people. The first person has to enter a secret number. Then the screen has to be cleared and then a second person has ...
[6 replies] Last: Add it right before pause at the end of your code. I'm glad it worked ... (by TheNoobie)
Char Error
 
Hey, this is a beginner question. I have been doing this for awhile but stopped and need to be refreshed on this. Here is the code: #include <iostream> #in...
[2 replies] Last: So, then what would one use a char for? I have used them before, since... (by Sacred117)
by CStu
A Conversion Program
 
Hi there, I have to make a program for my C++ class and it's due tomorrow. Here is what the code should do: Create a program that allows the user to enter a ...
[17 replies] Last: @ascii: I read it =) (by ultifinitus)
by mobat
Subtract from Structure values.
 
I have a structure which is like: struct character { int health, strengh, agility, xCoord, yCoord; string classes, name, mof, skill1, skill2, skill3; ...
[2 replies] Last: Ive been puttin =- for a long time. THANK YOU! (by mobat)
by Asele
Making my code acceptable
 
I finally got my code completed for a program to average ten numbers (have it set to two for testing right now), but I am not happy with it. It's my understand...
[3 replies] Last: Remember that an array is just a pointer, so just pass your pointer ar... (by pyrospade)
April 2011 Pages: 1... 2223242526... 55
  Archived months: [mar2011] [may2011]

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