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
arevilla
NA
1
0
Pascal like function
Oct 2 2004 7:29 PM
Just for fun, i'm trying to mimic a Pascal like function readLn(vars[]) that can take as many variables as arguments as you wish and take their values from Console input. Like this: int num1, num2; string str1, str2; readLn(num1, num2, str1, str2) So far i have drafted the function as this: private static void readLn(params Object[] args) { foreach (Object i in args) { string vartype = i.GetType().ToString(); // Being i the variable it should get its value from // (vartype).Parse(Console.ReadLine()); // Something like that :P } } Yes, not much at all. But since params won't accept being ref types i don't know how to modify original variables values (num1, num2, str1, str2, etc). Any ideas?
Reply
Answers (
0
)
my application is hanged when I send WM_COMMAND
Threads + WebResponse