Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
int[] temp_buf = new int[200];
int temp;


temp_buf[j++] = temp_t;

if(temp_t==1)
{

}

What I have tried:

convert int[] to int

temp_buf[j++] = temp_t;

if(temp_t==1)
{

}
Posted
Updated 24-Jan-19 20:26pm

1 solution

You can't "Convert int[] to int" - the former is a collection of one or more integers, the second is a single integer value.
You can perform aggregate operations on the collection to generate a new integer value (such as adding them all together, multiplying them all together, and so on) but you can't convert a collection to a single item. That's like saying a page is a collection of words, so lets convert this page into a single word! It doesn't work - you can apply an aggregation operation to a page such as "create summary" or "mark as an essay" to shorten it, but that's about all.

THink about exactly what you are trying to do with the array, and explain that. We'll try to help if you explain in sufficient detail.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900