🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.migration
Article #173

Problem when i return a Class

#173
From: Cherubino Ferrario
Date: Sun, 16 Jul 2006 17:48
34 lines
1686 bytes
Hello, i have a Big problem with C++ Builder 6 enterprise:

i write this simple code

main()

 {
   class1 Temp;
   class2 Temp1;

    Temp=Temp1.CompileClass();

 }

class1  __fastcall Calss2::CompileClass(void)
 {
  class1  Istance;

   return Istance;
 }

When the program go to line return Istance he call the destructor of class1 
and than the operator = of class1. I have acces viotation because Istance is 
not allocated.

If i compile the same program with c++ builder 5 professional the program 
work well.

Can you help me?  I must set some parameters in the Builder 6 project 
option?

Thanks for your attention

Cherubino Ferrario 
Technical Details
Message-ID: <44ba7c21@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!feed.xsnews.nl!feeder.xsnews.nl!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,9c1a1c988e79ed1d,start
X-Google-Attributes: gid110f51,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Cherubino Ferrario" <cherferr@tin.it>
From: "Cherubino Ferrario" <cherferr@tin.it>
Newsgroups: borland.public.cppbuilder.migration
Subject: Problem when i return a Class
Date: Sun, 16 Jul 2006 19:48:14 +0200
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 62.10.9.30
Message-ID: <44ba7c21@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1153072161 62.10.9.30 (16 Jul 2006 10:49:21 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!feed.xsnews.nl!feeder.xsnews.nl!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail