Cannot implicitly convert type 'T' to 'Int'

后端 未结 6 1804
轻奢々
轻奢々 2020-12-16 14:38

When trying to call this function in my code i get the error in the title. Also Operator \'+=\' cannot be applied to the operands of type \'int\' and \'T\'

p         


        
6条回答
  •  北海茫月
    2020-12-16 15:13

    you can try casting the value like this ...

    t += (int)value; 
    

    or

    t+= Convert.ToInt32(value);
    

提交回复
热议问题