Search:

Type: Posts; User: grimjb

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,446

    need help with exceptions

    I have defined a class called Exception as follows:

    #include <iostream>
    #include <string>
    class Exception{
    string s;
    public:
    Exception(string error): s(error){};
    friend...
  2. Replies
    11
    Views
    1,532

    that did the trick =)

    Thanks everyone for giving a C++ newbie a hand. This is a great forum! you guys rock.
  3. Replies
    2
    Views
    2,029

    you could have info return the value you want to...

    you could have info return the value you want to use outside the function. For example:

    int info ()
    {
    do all this stuff which includes int a;
    }

    int main()
    {
    int a;
  4. Replies
    11
    Views
    1,532

    ok my new method looks like this: ...

    ok my new method looks like this:

    PolyLine(const PolyLine* &src)
    { //cout << "inside deep copy\n";
    int i;
    double x1, x2;


    xArray = new double[src->length];
    yArray = new...
  5. Replies
    11
    Views
    1,532

    That works, but...

    I am writing this as part of an assignment and the assignment says that the method should be called using the following statement:

    PolyLine p2 (p1);

    I think I have to change my method signature...
  6. Replies
    11
    Views
    1,532

    thanks guys... one more question...

    I tried to print the PolyLine after the new and improved destructor and I can honestly say that I've never been to happy to see a segmentation fault =)

    Could you guys answer another question for...
  7. Replies
    11
    Views
    1,532

    need help with destructor

    I have a class named PolyLine with the following data members:

    double *xArray;
    double *yArray;
    int length;

    I have a destructor:

    ~PolyLine()
    {
Results 1 to 7 of 7