Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
hawski
on Dec 12, 2014
|
parent
|
context
|
favorite
| on:
15-line hash table in C
>Due to C there is no way to declare both an int and that in the loop preamble so you'd need at least one more line
In C99 it's allowed to declare in the loop preamble. True for ANSI-C.
pwr22
on Dec 12, 2014
[–]
Not differing types
camgunz
on Dec 12, 2014
|
parent
[–]
If you really want to, I think you might be able to declare a struct in there. A curse on your house though....
pwr22
on Dec 12, 2014
|
root
|
parent
[–]
In the end I wanted the variable to persist beyond the end of the loop anyway
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
In C99 it's allowed to declare in the loop preamble. True for ANSI-C.