Length of Array of Structs

Hello. I couldn't find a good answer to this question, so I thought I might ask it here. I am trying to get the length of an array of structs automatically (how many structs there are in the array). Is there an easy way to do it?
Thank you!
Is it a variable or a function parameter?
You are using built-in auto-allocated arrays?
Well, I first declared a structure single_card, then I used single_card cards[3] to declare the array. Then I tried to pass it into a function, so something like:

1
2
3
void get_card(single_card cards[]) {
...
}


Now I would like to use the length of the array... get it automatically, I guess.
Thanks!
You can't like that. You will need to pass the size manually, or use an STL container.
I see... Thank you so much!
Topic archived. No new replies allowed.