Search:

Type: Posts; User: cool_guy

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    866

    Pointer question

    Hi, I'm a bit confused on this pointer question, can anyone shed some light on this?
    Please and thank you




    int main()
    {
    int x = 10;
    int *p;
  2. Replies
    5
    Views
    1,540

    The header that we received in our lab was simply...

    The header that we received in our lab was simply this


    ostream &operator<<(ostream & out, Staff &s)
    istream &operator>>(istream & in, Staff &s)


    The parameter s, like you said not that well...
  3. Replies
    5
    Views
    1,540

    istream &operator>>(istream & in, Phone &s) {...

    istream &operator>>(istream & in, Phone &s)
    {
    in >> s.number;
    return in;
    }



    Fixed.
  4. Replies
    5
    Views
    1,540

    Overload insert/extract operator

    Hi all, for our lab exercises we were asked to overload both the << and >> operator for a class we made named Phone

    From what our instructor has told us....



    friend ostream...
  5. Replies
    2
    Views
    1,123

    Thanks Stiltskin that fixed the error I kept on...

    Thanks Stiltskin that fixed the error I kept on receiving!!
  6. Replies
    2
    Views
    1,123

    Traversing linked list help

    Hi all, I'm in need of some help.
    I made a simple linked list, but when I try to traverse through it in reverse, I keep getting a "exception error"...can someone shed any light on where I'm going...
  7. Replies
    10
    Views
    4,010

    Yes the text file doesn't contain all the info...

    Yes the text file doesn't contain all the info for the terrain only location of the crators, the elevation of the crators are in a different txt file, but that only has to go inside a 1d array and...
  8. Replies
    10
    Views
    4,010

    The text file just gives us a bunch of numbers,...

    The text file just gives us a bunch of numbers, and our program is to determine which numbers out of these are craters. I honestly don't know why he gave us a 25 constant, he even gave us the 6 x 7...
  9. Replies
    10
    Views
    4,010

    This is the header that our instructor gave us...

    This is the header that our instructor gave us for Terrain


    #define N 25
    using namespace std;
    #include <iostream>
    #include <stdlib.h>
    #include <fstream>
    class Terrain
    {
  10. Replies
    10
    Views
    4,010

    Sorry I have to edit the COLUMNS part out and...

    Sorry I have to edit the COLUMNS part out and replace it with N, sorry I was typing that very quickly I lost track.

    What I mean by stop reading into the extra values past the 6x7 grid is this:...
  11. Replies
    10
    Views
    4,010

    Reading txtfile into 2d array

    Hi all, Im currently working on my first data structure assignment and we are required to read into data from a txt file into a 2-d array.

    the txt file has whole numbers that I'll need to use to...
  12. Replies
    4
    Views
    1,356

    I just wrote that to denote the brackets, to help...

    I just wrote that to denote the brackets, to help visualise that (-10) would have been decremented.
  13. Replies
    4
    Views
    1,356

    Thank you thank you, I finally got 10. x++ -...

    Thank you thank you, I finally got 10.

    x++ - --y * b / a;
    5 - (-11) * 2 / 4;
    5 - (-22)/4
    5 - (-5)
    = 5 + 5 = 10.
  14. Replies
    4
    Views
    1,356

    Trouble finding correct value

    Hey all, I know this is a newb question here but I'm having trouble finding the answer to this equation posed in one of my past year exam scripts.




    int z, x = 5, y = -10, a = 4, b = 2;
    //x...
  15. How to Declare Character array with filepath?

    Hey all, I'm working on my intro to computing science lab, and the lab deals with "declaring a character array and initilize it with the filepath where filepath is the location of the...
  16. Replies
    5
    Views
    944

    Oh, I think I understand now. IF a function is...

    Oh, I think I understand now. IF a function is called and if the parameter is passed by reference, then any changes to the values that are passed, also affect the real variable?
  17. Replies
    5
    Views
    944

    So if x holds a copy of the value of "a", then...

    So if x holds a copy of the value of "a", then why is the value of "y" changed? Is it due to the fact that, "y" is passed by reference? But if both values go into foo, then shouldn't both values be...
  18. Replies
    5
    Views
    944

    Function retuning incorrect value

    Hi all, I'm revising for my intro to computing class short-test two, and going through a previous year paper, I attempted to solve this function on paper, and the answer I got on paper for a was 6,...
  19. Replies
    5
    Views
    1,401

    I think I fixed the error now, i just wrote cout...

    I think I fixed the error now, i just wrote cout << "End of journey\n";
    after the closing bracket for the while loop, so now when I enter a few valid values, and enter a neg or zero it works.
  20. Replies
    5
    Views
    1,401

    yes, if I enter a 0 or a negative I'm out of the...

    yes, if I enter a 0 or a negative I'm out of the loop, but then the program just ends there, so where can I actually write the code to report to the user "end of journey", without the loop asking...
  21. Replies
    5
    Views
    1,401

    before the direction is actually checked, I have...

    before the direction is actually checked, I have also writted
    cout << "Enter direction your robot wishes to move, 1 for north, 2 for south, 3 for east, and 4 for west\n";
    cin >> direction;
    and...
  22. Replies
    5
    Views
    1,401

    entering 0s and negative values into while

    Im working on a robot project for my intro to computing science class and I'm stuck in quite a sticky situation. The robot reads only values from 1 to 4 to move north, east, south, west, 1,2,3,4...
Results 1 to 22 of 22