Could you explain exactly what you are doing there. Still really unsure about pointers.
Type: Posts; User: stillwell
Could you explain exactly what you are doing there. Still really unsure about pointers.
I'm trying to create a small RPG and I'm having trouble figurig out how to attach an inventory to a being when it's being created.
Please take a look at my code
Being.h
class Being
{
Anyone? All help is much appreciated.
Ok, now I've devided my classes into a project with header files.
Now I've run into a new problem :p
This is how my code looks now.
Hero.cpp
Thanks alot. Works now :)
Any help is much appreciated.
I need more help. I'm having trouble with the atk() function.
class Hero
{
public:
//Hero(){};
Thanks guys. I got my getHp function to work and decided to not set any values in the base class and just set values in the derived classes. Don't know if that's effecient?
This is what my code...
I'm trying to learn about inheritance, and now I'm having trouble accesing iherited variables.
#include <iostream>
using namespace std;
class Enemy
{
hehe, I'm a noobie :P
Works perfect now. Thanks for all your help guys.
Thanks to everyone who helped :D I have come upon a new problem, though. It deletes the list of movies even if I don't choose 'y' when the option comes up.
This is how my code looks now:
...
Thanks, the string input works now :D
But I'm having trouble fixing the menu thing. Got any tips for me?
OnionKnight, when I do that, the program simply jumps the movie title input. I don't understand why, but it does.
Indigo, could you tell me what other errors?
I've tried to make this small program that keeps track of my movie collection. However, I'm having trouble reading in movies with spaced names.
#include <iostream>
#include <fstream>...
psh, that's right. It's been a while :)
Thanks for the help
Im trying to switch the values of 2 arrays, but the output is completely wrong.
#include <iostream>
using namespace std;
void test(int a[], int b[], int antal)
Yay, now it works. Thanks for your help, MathFan :D
I know. The effect is wanted :)
1. That's my problem. I need to read in 2 numbers for every cycle from test.txt. Need to read in s and d.
2. Ok, but how do I write it then? With a space, like this:
1.11 55.55
3....
I have made a program that measures the speed of a shot on goal in soccer. I need it to read from a .txt file and write to another. My problem is that I need 2 simultanious readings from the file,...
Arg, this is killing me. I did as you said with the simplestuff.h file, and the error went away...but was replaced by a new one :(
C:\Documents and...
I just did that and I have the same problem. Which of the files should be linked in 'Resource directories', and which should be linked 'Included directories' ? Do I only need to link in of the...
Hmm, I added it to the project and pressed 'Rebuild all', but then it gives two error messages. Now it says: In file included from mine rescourser/simplestuff.cpp
Is it because I have placed the...
I need some more help.
I'm trying to make my own header file, but I'm having some trouble. I have placed the .cpp file and the .h file in different directories, and have linked to those...
Yea, I see it clearly now. Thanks guys
btw, is it best to make the function void if it doesn't return a value, or deosn't it matter?
I'm trying to make a function that makes the number of endlines put into the integer, but it gives me these weird errors. What's wrong with my code?
#include <cstdlib>
#include <iostream>
...
int is a variable that can hold whole numbers only. No decimals. I can't remember it's restrictions, but it's far more than 2 digits.
int a = 1300086
double w = 12.56
valid variable...