how continue processing such an array to integers?

Hey :slight_smile:

I'm accessing an api and I get (after some processing) for example such an array out of it:

[568,275,3515,223842,597,3612,13080,1406,597,4872,48414,674,117135,224461,1282,2902,24438,205,699,299]

What is the best way to get each number as an seperate integer?

Depends on what you want to do with the numbers. For example, do you want a separate variable for each number in the array or do you want to, say, average all values in the array?

I want to draw a bar chart to a LCD where each value is a bar

strtol(). When you say, "array", I assume you really mean the string you are showing us. Some of those values won't fit in an int type. But I am probably assuming too much. Is this "API" running on a PC? Is there an Arduino involved?

that seem helpful :smiley:
can you recommend a site where this function is well explained?

That "Api" runs on a router. And the values are the current data throughput to the internet.

Maybe this?

grainy:
that seem helpful :smiley:
can you recommend a site where this function is well explained?

That "Api" runs on a router. And the values are the current data throughput to the internet.

strtol() is documented in any decent C++ reference, and you can find it here. You have to parse the string to extract the numbers, you can do that with strtok(). Remember to use the long or unsigned long data type, int is too small.

thank you very much. That was honestly the most pleasant experience I ever had in a forum :smiley: