Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert int to int[]

Status
Not open for further replies.
int is a single instance int[] is an array of intergers. you cannot cast one to the other, instead to you need to create a new array and add the single instance to the array.
Code:
int i = 1;
int[] iArray = new int[] { i };

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top