Last active
August 29, 2015 14:05
-
-
Save Leandros/67a55986aa8e72b1ac66 to your computer and use it in GitHub Desktop.
Preperation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test { | |
public static void main(String[] args) { | |
List<String> list1 = new ArrayList<String>(); | |
List<String> list2 = new ArrayList<String>(); | |
list1.add("preInput"); | |
list2.add("preInput"); | |
// Compute values. | |
List<List<String>> list = computeValuesBasedOn(input1, input2, list1, list2); | |
list1 = list.get(0); | |
list2 = list.get(1); | |
} | |
private List<List<String>> computeValuesBasedOn(String input1, String input2, List<String> list1, List<String> list2) { | |
List<String> newList1 = list1; | |
List<String> newList2 = list2; | |
// Add more items to the lists. | |
List<List<String>> list = new ArrayList<List<String>>(); | |
list.add(newList1); | |
list.add(newList2); | |
return list; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
void computeValues(NSString *input1, NSString *input2, NSMutableArray *list1, NSMutableArray *list2) { | |
[list1 addObject:input1]; | |
[list2 addObject:input2]; | |
} | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSMutableArray *list1 = [[NSMutableArray alloc] init]; | |
NSMutableArray *list2 = [[NSMutableArray alloc] init]; | |
[list1 addObject:@"preInput"]; | |
[list2 addObject:@"preInput"]; | |
computeValues(@"input1", @"input2", list1, list2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment