TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mansoorl
NA
1
0
Having prob looping through an array of struct elements
Apr 22 2005 1:06 AM
Hi everyone, I am trying to loop through an array of structure elements and based on a condition of equality I want to modify one of the elements of the struct. Here is the code for it. public struct CartItem { public int product_id; public int[] product_option_id; public int qty; public int school_id; } public class Cart { CartItem[] cartItems; public void AddItem(CartItem NewCartItem) { foreach (CartItem ci in cartItems) { if (ci.Equals(NewCartItem)) ci.qty = NewCartItem.qty; } } } The error I am getting is during compile. It complains on line //ci.qty = NewCartItem.qty; The compiler says "The left hand side on an assigment must be a variable, property or indexer. Can someone please help me out here... Thanks, Mansoor.
Reply
Answers (
1
)
C# & Crystal Reports Query Engine error
How to download a file using ASP.NET?