what to use instead of subset function

in processing you can generate subsets according to whatever conditions you want. what do you do for arduino if you need this kind of function.

in processing you can generate subsets according to whatever conditions you want.

No, you can't. Therefore, what you think you are doing, and the words you are using to describe that do not match. So, you need to post the Processing code, so we can see what you are referring to, incorrectly, as a subset.

String[] sa1 = { "OH", "NY", "CA", "VA", "CO", "IL" };
String[] sa2 = subset(sa1, 1);
println(sa2);
// Prints the following array contents to the console:
// [0] "NY"
// [1] "CA"
// [2] "VA"
// [3] "CO"
// [4] "IL"
println();
String[] sa3 = subset(sa1, 2, 3);
println(sa3);
// Prints the following array contents to the console:
// [0] "CA"
// [1] "VA"
// [2] "CO"

OK. There is no C++ equivalent.

You need to define fixed size arrays (the compiler can count to determine the fixed size). You can then copy data from one array to another, using a for loop.

i am trying that way at the moment but it is very inefficient.

i am trying that way at the moment but it is very inefficient.

For who?

arduidiot:
i am trying that way at the moment but it is very inefficient.

You can be sure that is what Processing is doing under the hood.

...R

arduidiot:
i am trying that way at the moment but it is very inefficient.

In what way is it inefficient to start at position 2 in the array, and print the next 3 elements? Sounds efficient enough to me.

actually its fine ive got it sorted. basically ive got my mega running a sketch that generates a "state configuration" eg {0,1,0,0,0,...} for my 16 digital output pins and i have my 16 analog inputs printing read outs for each configuration. i wanted my sketch to read whats printed to serial, and only write unique state configurations and their corresponding analog read values, to the SD card, in effect what i end up with is the data for the analogRead() for every unique permutation of the states of the 16 outputs.

but ive decided to not bother about using the SD ( whose enclosure has broken anyway, they should make the next mega's alot more durable) and just make a processing sketch that does this part

Basically it runs so i can stick a heap of random devices and parts of computers i dont understand the operation of and interpret the collected data to understand how it behaves electrically. yep im noob of the month i know.