class pointers

Discussion in 'C++' started by Daqian Yang, Jan 28, 2004.

  1. Daqian Yang

    Daqian Yang Guest

    Hi all,

    ----code-----
    int main(){


    xf::Xfile x;
    cout <<"before compressing"<<endl;
    x.stats();
    cout <<"after compressing"<<endl;
    x.compress();
    x.stats();

    xf::Xfile x2 = xf::Xfile("mydata",3,2);
    xf::Xfile x3(x2);


    x3.stats();


    // xf::Xfile* p = new xf::Xfile("mydata2,5,5); //problem is here
    // p->stats();

    return 0;
    }

    ---code----------

    without this line "xf::Xfile* p = new xf::Xfile("mydata2,5,5);" , the
    program works perfectly.

    but after I insert a pointer here, the compiler gives me this error:

    x-main_a2.cpp:22:32: missing terminating " character
    x-main_a2.cpp: In function `int main()':
    x-main_a2.cpp:25: error: parse error before `return'
    x-main_a2.cpp:22: warning: unused variable `xf::Xfile*p'

    anyone knoews why? thx :)
    Daqian Yang, Jan 28, 2004
    #1
    1. Advertising

  2. Daqian Yang

    Daqian Yang Guest

    everyone ingore my post...

    thx..sorry,just missing a " here -_-
    Daqian Yang, Jan 28, 2004
    #2
    1. Advertising

  3. Daqian Yang wrote:
    >
    > Hi all,
    >
    > ----code-----
    > int main(){
    >
    > xf::Xfile x;
    > cout <<"before compressing"<<endl;
    > x.stats();
    > cout <<"after compressing"<<endl;
    > x.compress();
    > x.stats();
    >
    > xf::Xfile x2 = xf::Xfile("mydata",3,2);
    > xf::Xfile x3(x2);
    >
    > x3.stats();
    >
    > // xf::Xfile* p = new xf::Xfile("mydata2,5,5); //problem is here
    > // p->stats();
    >
    > return 0;
    > }
    >
    > ---code----------
    >
    > without this line "xf::Xfile* p = new xf::Xfile("mydata2,5,5);" , the
    > program works perfectly.
    >
    > but after I insert a pointer here, the compiler gives me this error:
    >
    > x-main_a2.cpp:22:32: missing terminating " character
    > x-main_a2.cpp: In function `int main()':
    > x-main_a2.cpp:25: error: parse error before `return'
    > x-main_a2.cpp:22: warning: unused variable `xf::Xfile*p'
    >
    > anyone knoews why? thx :)


    The compiler already told you. missing terminating " character.
    Look up the line in question:

    > // xf::Xfile* p = new xf::Xfile("mydata2,5,5); //problem is here

    ^
    Where is the closing " for this ---+

    --
    Karl Heinz Buchegger
    Karl Heinz Buchegger, Jan 28, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    4,743
    Thomas Weidenfeller
    Oct 12, 2005
  2. Phil
    Replies:
    1
    Views:
    644
    llewelly
    Sep 16, 2003
  3. muser
    Replies:
    3
    Views:
    760
    Ron Natalie
    Sep 18, 2003
  4. A
    Replies:
    3
    Views:
    455
    Alan Kelon
    Oct 29, 2003
  5. cerr

    pointers, pointers, pointers...

    cerr, Apr 7, 2011, in forum: C Programming
    Replies:
    12
    Views:
    672
Loading...

Share This Page