I think you are working with some outdated assumptions. I coded directly C using GCC for several months, and you do not need to declare variables at the beginning of the block, although the second version of K & R says what you need. You can declare your variable anywhere, for example, this not very useful example:
char* palstring; palstring = malloc(LARGEST_STRING); memset(palstring, 0, sizeof palstring); fgets(palstring, LARGEST_STRING, fin); char* cur = palstring; char letter; letter = *cur;
Therefore, you do not need to do what you offer. The tongue has moved.
Another nice addition to the C language is Variable Length Arrays, which allows you to pass an array of a function along with its size. In the old days, all you could do was pass a pointer.
rtperson Feb 12 '09 at 15:20 2009-02-12 15:20
source share