this is a quick question, Im translating a program that's in C++ to C, and I saw this line of code,
for (int v : adj[u]) { referenced in this article: link
and I am not really sure what it does. I tried googling it and got results for range based for loops in C++, but cannot find anything that has this exact syntax and what it means. Help would be much appreciated.
adjis some sort of container of containers, which makesadj[u]a container that can be the range of a range-based for loop. Without knowing more aboutadjandadj[u]we can't really be more detailed.for (<declaration> : <expression>). If you don't understandadj[u], look at the declaration ofadj.