saurabh jain wrote:
> Hi,
>   I have something like this in my code:
>
> struct s{
>     ...
>     ...
>     struct s* next;
>   
the "struct" is redundant (in C it was required, not C++).
>    ...
>    ...
> };
>  
>
> In a main I have: vector<s> vs;
> And I am using an iterator(vector<s>::iterator vsitr) to traverse the vector. 
> What I want to know is how to assign the struct s* next of the structure 
> using this iterator.
>   
you're attempting to put a "link" in a struct which is held in a 
vector?  why??
> I am doing something like : struct s* next = &(*vsitr);
> Is it correct? Seems to be working fine for me right now!  Is there a cleaner 
> , better and safer way to achieve this?
>   
why not put an iterator in s instead of a pointer?  (there are some 
things that C requires you to do that just get in the way in C++)
> Thanks,
> Saurabh
>
>
> -----------------------------------------
> I don't *mix* well socially....
> but am readily *soluble* with alcohol...
>
>
>
>
>
>       
> ____________________________________________________________________________________
> Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, 
> and more!
> http://tv.yahoo.com/collections/3658 
>
>
> To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. 
> Yahoo! Groups Links
>
>
>
>
>   

Reply via email to