C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

std::vector in funktionsaufruf

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German)
View previous topic :: View next topic  
Author Message
Alexander
Guest





PostPosted: Mon Dec 08, 2003 3:14 pm    Post subject: std::vector in funktionsaufruf Reply with quote



Hallo Newsgroup,

habe einige Bücher gewältzt, aber keine Antwort auf meine Frage gefunden.
Deshalb:

wenn ich eine funktion aufruf, also

abc (vector<int> x){}

übergebe ich jedesmal auf eine Kopie zu.
Wie kann ich aber auf einen Vektor zugreifen (Orginaldaten) ohne die Gefahr
zu haben die Orginaldaten zu überschreiben!
Da bei:

abc (vector<int>& x) die gefahr besteht den Vektor zulöschen!

Danke für die Hilfe!

Gruß
Alexander

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
Back to top
Falk Hueffner
Guest





PostPosted: Mon Dec 08, 2003 3:34 pm    Post subject: Re: std::vector in funktionsaufruf Reply with quote



"Alexander" <camek (AT) in (DOT) tum.de> writes:

Quote:
wenn ich eine funktion aufruf, also

abc (vector<int> x){}

übergebe ich jedesmal auf eine Kopie zu.
Wie kann ich aber auf einen Vektor zugreifen (Orginaldaten) ohne die Gefahr
zu haben die Orginaldaten zu überschreiben!
Da bei:

abc (vector<int>& x) die gefahr besteht den Vektor zulöschen!

abc (const vector<int>& x)

--
Falk

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.