|
|
|
|
|
by dllthomas
4349 days ago
|
|
Of course, you can build your own closure: void do_stuff_with_file(struct relevant_data *, FILE *);
...
{
struct relevant_data data = { ... }
with_open_file_for_writing(do_stuff_with_file, data, filename);
}
IMO, the biggest downside there being how far it typically pushes the definition of that function from the call site. Small functions - a good practice anyway - ameliorates that a bit. |
|