[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Hvilket sprog



On Wed, 30 Jun 2004 11:10:00 +0200
Egon Andersen <sslug@sslug> wrote:

> En af de store nyheder i ISO-C99, er netop at variabler kan erklæres i 
> block-scope, så ovenstående virker faktisk hvis du anvender ISO-C99!

Det er en ofte set fejltagelse, at variable ikke kunne erklæres i
block scope i "K&R-C"

det har altid været tilladt at skrive

int main(int argc, char *argv[])
{
    printf("Start\n");
    {
       int y;
       for (y=1; y<10; ++y) {
          printf("Meter: %d    Nordsjællandske fod %f\n", y, 3.123456 * y);
       }
    }  /* --------------  here endeth scope of variable y */
    printf("Slut\n");
}

Det nye er, at du må lave "int y=1" ***INDE*** i for-løkken.




-- 
donald_j_axel donax snabela get2net.dk -- http://d-axel.dk/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *