Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > class pointers

Reply
Thread Tools

class pointers

 
 
Daqian Yang
Guest
Posts: n/a
 
      01-28-2004
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





 
Reply With Quote
 
 
 
 
Daqian Yang
Guest
Posts: n/a
 
      01-28-2004
thx..sorry,just missing a " here -_-


 
Reply With Quote
 
 
 
 
Karl Heinz Buchegger
Guest
Posts: n/a
 
      01-28-2004
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pointers, pointers, pointers... cerr C Programming 12 04-07-2011 11:17 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
c++: pointers to pointers A C++ 3 10-29-2003 01:15 PM
pointers to pointers // exception handling error muser C++ 3 09-18-2003 06:19 PM
Template specialization of pointers with function pointers Phil C++ 1 09-16-2003 02:17 AM



Advertisments