Yeah, in the example im working with, the ampersand is used in fron of the variable:
T& operator []
Type: Posts; User: Gamma
Yeah, in the example im working with, the ampersand is used in fron of the variable:
T& operator []
What is the '& operator' and how does it work?
Can someone explain these two lines of code please,
Line one
T& operator[] (int i) {return at (i); }
What is 'operator', and 'at'?
Line Two
Can someone explain what the colon does here:
template<class T> class Vec : public vector<t> { ...
Thanks!
What is the purpose of the template keyword, and how is this keyword used? What is the putpose of a template class, and how is that used?
..." A vector is a single object that can be assigned. For example:
void f(vector<Entry>& v)
{
vector<Entry> v2 = phone_book;
v = v2;
//...
}
What is the purpose of vector?
What is the purpose of the struct keyword?
I need an explination of this:
..." The range of an enumeration holds all the enumeration's enumerator values rounded up to the nearest larger binary power minus one"...
What does implementation-dependant mean?
can someone try this program out to see if it works maybe its a problem with my compiler, i made the changes and i got more errors than i did the last time, HELP!
ps the reason why the classes are...
What is a scope operator?
What does implicit declaration of a function mean?
exactly what sould i change, i made it int main () and return 0;, i actually did that many times before and it still did not work. Then what should i do with the output2, remove it completely? When...
Hey people,
I have a program here which is giving me a lot of problems. Im just learn c++ and I'm following a book, the excercise is spearation of interface and implementation.
Here's the code...
Hello people, I need an example and explination of the const keyword used in method signatures. I'm using a really, crappy book and i don't understand what they are trying to say. Thanks!
but how would it be used, and would the results be the value of hours and minutes??
Im using a book that quote this as a copy operation used to return a reference as a value, but i dont understand how it works, and how i would be used...
TimeOfDay createTimeOfDay (int hours,...
thanks that solved the problem!:D :D :D
I tried the changes but it still doesnt work, but now im only down to one error, parse error on line 17, but i only have 16 lines, here's the code so far:
#include <iostream.h>
class Exchg {...
i'll try to do that, but im using a book to learn c++ and it is very good, it leaves out stuff all the time, grrrr...:mad:
I need this program to display the output (" 111 56 "). Whats the problem with it?
#include <iostream.h>
class Exchg {
public:
void exchange (int& a, int& b) {
...
What does de-referenced mean? :confused:
Is there some code that i can use to disregard some parts of my code so i can see how the program runs without using the particular lines of code?
ps i still need help on my other project here:...
[CODE]
#include <string.h>
#include <iostream.h>
#include "pair.h"
class Date : public Pair {
public:
int getYear () {
return aYear;
}