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;
Type: Posts; User: cool_guy
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;
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...
istream &operator>>(istream & in, Phone &s)
{
in >> s.number;
return in;
}
Fixed.
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...
Thanks Stiltskin that fixed the error I kept on receiving!!
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...
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...
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...
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
{
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:...
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...
I just wrote that to denote the brackets, to help visualise that (-10) would have been decremented.
Thank you thank you, I finally got 10.
x++ - --y * b / a;
5 - (-11) * 2 / 4;
5 - (-22)/4
5 - (-5)
= 5 + 5 = 10.
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...
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...
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?
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...
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,...
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.
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...
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...
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...