Many thanks Elysia
Type: Posts; User: Draylath
Many thanks Elysia
Thanks Elysia,
I have it now. I actually sorted it before I read your message (that'll teach me to code on the edge of my understanding when I'm tired). Advice on references will be taken. I'll...
Hello folks,
I'm working through the section on pointers in my ebook and I decided to try some things out. I'm finding a it a bit hard going though and I've run into a problem. I'm getting compile...
I just worked it out
I think I'm just tired (nearly the end of term). Thanks a lot for your help folks :)
I'm sorry. I must have taken stupid pills today.
I'm not sure why employees[2] is out of bounds as I thought elements in an array number from 0 so it is a 3 element array and the loop should loop...
Hi there,
I'm trying to learn using stuctures and I've come up with a little thing that combines them with loops and arrays. It might not be a very elegant solution if it did work but instead it...
I hadn't forgotten. All done and done now and thanks for the input I really appreciate it :D
Thanks for the reply
I get it now. The prototype and definition have to have the return type in the call is just the function name +arguments.
Cheers
I just want to send an integer to the printout() function to print it but it just seems to get the variable and then exit. What is it I'm doing wrong? Thanks
#include <iostream>
using...
yes, it was what I wanted except for it ending at x11 (I wanted it to get to 12 but that was simple to fix). The point about global variables is understood. I just used one here as it is the only one...
sorry please disregard!
It was so simple even I worked it out
Apologies for wasting peoples time
Hello,
I am writing a very simple program to print out multiplication tables. (I always did stink at maths).
I think I have it written correctly but I get unexpected out put:
#include...
got it!
I think I need to re read the parts of my book on the assignment operator and assigning values to variables. I thought that number = p_number and p_number = number would have been the same...
From what I understand so far (which I grant you is not that much) that should be about right. I've put in variable "number" input from main and assigned p_number that value. Obviously this isn't...
#include <iostream>
using namespace std;
class record
{
private:
int p_number;
mmm, now it's back to saying 2 again regardless of input. sorry to keep on about this I just want to get this right
I think I am closer now but it is still not working. I'm getting compiler errors now. I've done the following:
int main(){
int number;
record Clive;
cout << "set employee...
That'll be the problem then, thanks Jim. You're quite right. I haven't assigned it a value at all have I? Apologies for me getting you to point out the obvious. Thanks again I'll keep bashing away at...
I'm trying to pass the value of int number in the main part of the program into setp_number so that it will set the user input number into Clive and then be retrieved with getp_number. In all my...
Actually I am seriously lost now. Seems I've cut one head off the hydra :)
no matter what I input to the p_number it always comes back at me as 2 not what I inputed
oh crap I feel a bit silly now,
thanks antred for clearing that up with the system("PAUSE"). I did know about that just my tired mind :)
I'm lost on your comment on reading what return does but...
Hi there,
sorry if this is really stupid but I am trying as hard as I can to understand classes from a book. I have declared my class and put in the accessor functions and declared everything...
of course! of course!. Thanks so much.
I feel a little daft now but I think lesson learned. cheers! :D
Hi there everyone. This is my first post so I hope I get all the ettiquette right.
I am just getting started learning C++ from books and am really enjoying it but running into some of the problems...