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
Guest User
Tech Writer
357
121.1k
Using input parameter with Enum value
Mar 17 2012 3:06 PM
Hi
Given the following code example
// Method declaration
private bool ValidRequest(RequestBase request, ResponseBase response, Validate validate)
// Condition statement
if ((Validate.ClientTag & validate) == Validate.ClientTag)
Validate is an Enum with a variable ClientTag that has a value of 0x0001 assigned.
Am I right in saying that given Validate.ClientTag is an Enum, the assignment operator cannot be used to Set the input parameter validate. As a result the & operator needs to be used instead?
In addition the expression (Validate.ClientTag & validate) has to be encapsulated into its own parenthesis within the if statement due to the mismatch of types ClientTag and bool?
Thanks
Reply
Answers (
4
)
Could not find file "C:\WINDOWS\system32\
.Net2000 and .Net2005