OK, thanks. I did use the search but just for this section. Also, I am using this in C++ and I see that that thread is in the C Programming section. There must be a difference.
Type: Posts; User: Cypher
OK, thanks. I did use the search but just for this section. Also, I am using this in C++ and I see that that thread is in the C Programming section. There must be a difference.
What exactly would I do with that string?
Simply printing it out in the console won't do anything... or would it..?
How can I use a variable in a system function?
i.e. I want to make a simple little program that you can put an IP address into the program and it will ping it for you. I would do something like...
OK, the program seems to be working just fine now. Thank you so so so so so much for your help. I understand how frustrating it can be helping a noobie out and I really really appreciate your help....
Um, I really don't know what you're talking about. I remember when I was trying to learn Java there was a command thing "this"
Is that what you're talking about?
OK, what I'm going to try and do is finish up this game and then do my best to learn more about classes in C++. I really don't understand what you mean by "pass it" and I did try to Google it but I'm...
I think I did what you said correctly, I'm getting more errors though that I don't know how to fix.
Compiler: Default compiler
Building Makefile: "C:\Documents and...
Input from anyone would be greatly appreciated.
I think I might have done something wrong when I did that.
The error
ShopClass.h:12: error: variable or field `ShopMain' declared void
ShopClass.h:12: error: expected `;' before '(' token
...
..and the rest.
The only place where I call the MainManager function is at the end of the shop and battle classes. They just do manager.MainManager();
There's really nothing to show. I just think that I'm putting...
Initialize the object? That's kind of like doing something like this?
GameManager manager;
manager.SomeFunction(initialize a variable, another variable);
So, if that's what it is, then what do I...
Here is my GameManager.cpp file:
#include "GameManager.h"
#include "ShopClass.h"
#include "BattleClass.h"
#include <iostream>
#include <cctype>
using namespace std;
...
Alright, I fixed that problem. I had the variables in the MainManager function too, I took them out and it fixed that. I'm still getting that problem where every time the program goes back to the...
more files
I have a battle and shop class and ShopMain and BattleMain are functions in the classes and they call on the AddMoney and other functions in GameManager.
Did you try the game? The numbers are all...
When you say member variables do I just put them in with the "private" variables? I really don't know what member variables are and tutorials on Google aren't very helpful with that.
The program...
There is always that question of which is better. So I'm asking you guys, why did you choose C++? If you have tried both Java and C++ say so and let me know which you like better and why.
So can I just take out the constructor in GameManager and declare the variables in the header file?
There is no error message
Header File
#ifndef GameManager_H_GUARD
#define GameManager_H_GUARD
#include "ShopClass.h"
#include "BattleClass.h"
#include <iostream>
using namespace std;
This is the constructor where I placed the variables.
GameManager::GameManager() : money(200), lives(3), attack(0), defense(0) {}
I'm going to be trying different things on my own, but tell me if...
bump, I could really use the help on this one.
OK, I wasn't using inline before so I didn't need the implementation in the header, so that wasn't the problem.
I took them out and the program ran now. I don't understand why it didn't run...
So if a function is going to be called more than once, I need the inline command...
I am getting linker errors now.