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
Ilkin Turk
NA
349
161.1k
c# return value throug params keyword
May 18 2014 6:09 AM
Hello ,
in below method - How to return value with params keyword.It is possible if change Do method return type to int.But I need to do it with void and params keyword.
Thanks in advance.
private void button1_Click(object sender, EventArgs e)
{
int x = 1;
Do(x);
MessageBox.Show(x.ToString());
}
public void Do(params object [] paramet )
{
int value = (int)paramet[0];
value = value + 2;
}
Reply
Answers (
6
)
C#
XML