How can I combine two numbers such as 7 and 6 to cast the number 76 or 3 and 3, so the result is 33, in objective-c?
There is no inline character to combine numbers. However, you can do this by doing:
int first; /* Assuming this is initialized to the first number */ int second; /* Assuming this is initalized to the second number */ int myVal = [[NSString stringWithFormat:@"%d%d",first, second] intValue];
FirstNum * 10 + secondNum: -)
, .
Objective-C NSStrings
x y xy,
10 * x + y.
7 6
7 * 10 + 6 = 76
objective-c, :
, nums = array (7,6), result = 0, foreach . : res = res * 10 + . , 7 , . :
Array nums = Array (7,6,8,9); int res = 0; int value; foreach ( nums) res = res * 10 + ;
, , . , , .
,
^
Source: https://habr.com/ru/post/1727128/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1727123/what-algorithm-should-be-used-when-doing-filechecksums-to-find-dupes&usg=ALkJrhiQ9GEEwDMp3JHccNAc6R5fl8Mk5ALearning Python and using dictionaries - pythonsql selection from a one-to-many table - sqlRender ASP.NET MVC для просмотра без HttpContext или ControllerContext? - asp.net-mvcPHP Comparison Confusion - typesGWT: reading file from server at server startup - gwtUsing browser caching - htmlHow to automate Microsoft Word 2003 from WPF? - c #trying to extract a file from blobstore and send it as an email attachment using the google engine - javaJUnit4 in Eclipse - javaAll Articles