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
John Burns
NA
120
109.1k
why the parenthesis around the data type?
Dec 17 2010 1:41 PM
just wondering why this arguments data type has parenthesis around it? here is the code. the part in question is in red.
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int length = Talker.BlaBlaBla(textBox1.Text,
(int)
numericUpDown1.Value);
MessageBox.Show("length is: " + length, "# of times");
}
also, if its any help, here is the class code that goes with it.:
class Talker
{
public static int BlaBlaBla(string thingToSay, int numberOfTimes)
{
string finalString = "";
for (int count = 1; count <= numberOfTimes; count++)
{
finalString = finalString + thingToSay + "\n";
}
MessageBox.Show(finalString, "text to say");
return finalString.Length;
}
Reply
Answers (
10
)
How to use a string as a name of a variable in c#
DirectShow problem with capture image in WM