John is just a quickly typed example of the sort of problem I am having in my game (I didn't want to post hundreds of lines of source code you know what I mean...?) yes I do need to make the said...
Type: Posts; User: Sclorch
John is just a quickly typed example of the sort of problem I am having in my game (I didn't want to post hundreds of lines of source code you know what I mean...?) yes I do need to make the said...
Shouldn't making it 'extern' relieve the necessity of having to pass it through the talk function? (Since its now global?)
Indented for you! :D
Ok I've added the 'extern person john' part. Still getting an error :(
Here's the updated header file:
//classH.h
#ifndef CLASS_H
#define CLASS_H
#include <string>
Ahh I see now :)
Thank you both
The main problem is with the classCPP.cpp file. I am trying to access the member variable "personName" of the object "john." (of class person) Since "john" is not declared in this cpp it gives me an...
Cool I wrote a small program that uses 2 cpp and 1 new h file that I wrote. Working great so far! thanks
Yep, am I wrong in assuming that the compiler will just link all of my files in a project together for me? Or do I have to manually link them all together?
Here were the steps I took:
Created...
ok thanks, i thought it would be something that had to do with the linker.
Thank you both for the quick reply. Still getting errors though strangely. I've updated functions.cpp so now it looks like this
#include <iostream>
#include "functions.h"
using namespace...
I'm having problems getting any programs with multiple cpp files to compile. I am using Dev-C++.
Here are my files:
//main.cpp
#include <iostream>
#include "functions.h"
using namespace...
Thank you!
I am writing a game where a certain location will point to a creature which resides there and also the creature points to the location where it is located. I am running into problems however because...
You were right, thanks anon!
Here is updated code that works great for my save game function in my game just in case anyone has similar problems to this in the future and stumbles upon this on the...
I'm having problems opening blank files with ifstream. It seems to be saving a blank line over my first string variable. For example I created a completely blank text file in notepad and saved it as...