thx all....and ghetto smurf is my real name :)
Type: Posts; User: Labmouse
thx all....and ghetto smurf is my real name :)
thx will try that ...seems alot less complex.No it doesnt mention what the external that is undefined(i think it normally does with varibles).
Tried that and still showing the same error message.I have Double checked the code and its copied verbatim as far as i can tell..
hi,
Im starting to read up on arrays.I copied some code and when i try to compile it I keep getting:
C:\Users\ghetto smurf\Documents\Visual Studio 2008\Projects\Array\Debug\Array.exe : fatal...
makes sense now.Thanks again
thanx elysia that worked.
So You only use '&' in the function prototype/definition and not actually when u make the function call
Hi,
how do u write a prototype of a function that passes by reference
//function definition
int playerLoss(int &playerMoney)
{
int x=45;
Thanks...in hindsight making a function that returns 1 random number and then calling it 4 times is fairly goddamm obvious!!
done as you said salem and the prog is working fine.thanks.
As a rule of thumb in header files i should only:
1)only declare varibles if they are global,not initialise them
2)only insert...
so i should have a paladin.h file where i should just declare:
int paladinHealth;
and then in paladin.cpp i should :
#include"paladin.h"
hi ,
have iniatilised some varibles in a seperate header fill so that they are global,but when i go to change them in main() i keep getting errors.
here's the header file:
#ifndef...
Ah ok so just function prototypes in the header file.So it will only return one varible.Haved learnt the use of pointers or structures yet so that path is a no go at the moment
Thanks all
heres my header file
#ifndef myfunctions_h
#define myfunctions_h
int randomNumbers()
Didnt include <iostream> in the header file but have in main().And also used cin.get() after the 4 couts in main.And also using namespace std in main.
only started C++ recently and am only reading up on pointers at the moment so that's beyond me at the oment but thanks anyway
Labmouse
Hi,
Just practising making my own header files and functions.I have created a function that generates 4 different varibles.I have set the function to return all 4.It compiles fine but when i call...
I have being using Dev-C++ but have beeb told that code::Blocks is better.Should i switch?Is it ok to have the 2 IDE's on 1 pc?
Im happy enough using Dev-C++ but again i only have a basic...
Thanks was using
#include<myfunctions.h>
and not
#include "myfunctions.h"
Hi i created my first header file but cant fathom out how to use it.I have saved it as .h file extension and its in the folder where all my source files are saved.Any tips?
heres the header file...
Thanks will try the function as it could be used across the board,only just started reading up on functions and prototypes but will give it a go
Hi,
Is there a quicker way of doing this bit of code.want to roll 5x ten sided dice and add the results.The way i have done it looks nasty,
int playerHealth=( (rand ()%10)+1)+( (rand...
Yep Twomer put in the cin.ignore at the offending parts and it works fine.Im just curios why it works without cin.ignore for the 1st few questions and then starts acting quirky..
works fine down as far as 'your favourite number',then prints the next 2 questions,then waits for user input and then prints out the next 2 questions.Will try and put in cin.ignore at the offending...
Hi,
just doing a simple progamme for my younger brother(a funny news spread).The programme asks for his name,favourite simpsons character and the like but halve way thru the code it starts out...
Thanks Bench,was working out of a book but lost it(dont ask!)and couldnt find the command on the internet,
Labmouse