[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: [CPROG] 2d-tabeller



Du kan altid ændre din k[][] varabel når du har lyst, med:

     /* Opret og nulstiller alle tre arrays i k[][] som
       {{0,0,0},{0,0,0},{0,0,0}} */
  int k[][] = {0}; 
     /* Sæt array 3's plads nr. 0 til at være lig med værdien 1234 */
  k[2][0] = 1234;  

og så videre, så længe det er i samme funktion eller løkke da et array 
som alle andre variabler er lokale til en funktion.

Bjarke

Niels Sandmann wrote:
> 
> "Søren H. Sørensen" wrote:
> >
> > Hej.
> >
> > Din kompiler bliver sur fordi du prøver at sætte en simpel variabel lig
> > med en programblok - det kan man ikke.
> >
> > int main() {
> >    int k[3][3] = {5,6,7};
> >
> >    }
> >
> men jeg faar senere brug for at kunne aendre data'ene
> kan det passe at man ikke kan saette f.eks den 0'te liste i et array,
> bortset fra i initialiseringen ?
> 
> Mvh, Niels Sandmann

-- 
Bjarke Bruun - E-mail: sslug@sslug http://linux.hhknet.dk
   __
  / /  (_)__  __ ____  __
 / /__/ / _ \/ // /\ \/ /  . . .  t h e   c h o i c e   o f   a
/____/_/_//_/\_,_/ /_/\_\              G N U   g e n e r a t i o n . . .


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 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] *