Variable-length arrays and the max() mess
Variable-length arrays and the max() mess
Posted Mar 22, 2018 13:13 UTC (Thu) by HelloWorld (guest, #56129)In reply to: Variable-length arrays and the max() mess by dtlin
Parent article: Variable-length arrays and the max() mess
By the way, is it allowed to have a pointer that is one past the end of a variable that isn't an array? Something like this:
void print_ints(const int *begin, const int *end) { for (; begin < end; ++begin) { printf("%d\n", *begin); } } int main() { int i = 42; print_ints(&i, &i + 1); return 0; }
Posted Mar 22, 2018 13:17 UTC (Thu)
by HelloWorld (guest, #56129)
[Link] (2 responses)
Posted Mar 22, 2018 15:08 UTC (Thu)
by excors (subscriber, #95769)
[Link] (1 responses)
Posted Apr 12, 2018 23:24 UTC (Thu)
by HelloWorld (guest, #56129)
[Link]
Variable-length arrays and the max() mess
Variable-length arrays and the max() mess
Variable-length arrays and the max() mess