468,272 Members | 1,984 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

Re: sorting the input

On Wed, 10 Sep 2008 16:49:56 +0000, Erik Wikström wrote:
>arnuld wrote:
2) Is the program is a C++ program or C program written in C++.
I do not quite understand the question, this is clearly a C++ program.
I meant, are you sure I am using proper C++ design because after 6 months
of C my mind is locked on C, I can't think of C++ properly.

Like many people still keep on using C's procedural and design constructs
rather than of ISO C++.
> std::vector<std::string svec;
std::vector<std::string>& r_svec = svec;
Drop the r_svec, it serves no purpose.

but then will it not copy the vector ? rather than getting its reference ?
I am little confused on this. After removing r_svec Program works fine
though.

--
www.lispmachine.wordpress.com
my email is @ the above blog.
Google Groups is Blocked. Reason: Excessive Spamming

Sep 11 '08 #1
1 1295
On 2008-09-11 06:21, arnuld wrote:
>On Wed, 10 Sep 2008 16:49:56 +0000, Erik Wikström wrote:
>>arnuld wrote:
>> std::vector<std::string svec;
std::vector<std::string>& r_svec = svec;
>Drop the r_svec, it serves no purpose.


but then will it not copy the vector ? rather than getting its reference ?
I am little confused on this. After removing r_svec Program works fine
though.
No, since you have declared the functions to pass by reference no
copying will occur.

--
Erik Wikström
Sep 11 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Foodbank | last post: by
8 posts views Thread by ianar | last post: by
7 posts views Thread by abracadabra | last post: by
5 posts views Thread by lemlimlee | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.