[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



Den pæne måde at ændre indholdet på er efterfølgende at adressere
elementer enkeltvis, men kender du på forhånd de værdier du vil ændre
til kan du lave små 1-d arrays med dem i. F.eks....

int main( void )
  int k[3][3] = {{5,6,7}};
  int alt[3] = {1,2,30};

  /* skifte en række af andet index */
  memcpy( &k[0][0], &alt[0], 3 );

  }
Men det er sikkert ikke det du ønsker.....

Med venlig hilsen
Søren H. Sørensen


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


 
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] *