How to initialize several variables in a for (;;) loop in C? -
I thought someone could start multiple variables in but I know just now It's not possible that GCC returns the following error: you can not start You can (but should not usually) use of a local structure type. Since C +11, you start different parts more beautifully Unless they are dependent on local variables: This is actually quite readable to actually use. The problem with structured binding is set to address C ++ 17: However, the detailed feature set and syntax are still in Flux. for loop
:
for
(int i = 0, char * ptr = bam; i & lt; 10; i ++) {...}
Error: Expected unauthorized-id required before 'four' - is it really true that you have different variables You can not start
for
loop
Ptr! = 0; ++ loopy.i, ++ loopy.ptr) {...}
for
(struct {int i = 0; std :: string status;} loop; loop.stat us! = " Done "; ++ loop.i) {...}
for
(auto [i , Position] = {0, "" s}; condition! = "Done"; ++ i)
Comments
Post a Comment