FAQ  •  Login

variable-sized array inside of a structure

<<

BSme964uw

Newbie
Newbie

Posts: 15

Joined: Mon Aug 18, 2008 9:32 am

Unread post Thu Dec 04, 2008 7:47 pm

variable-sized array inside of a structure

Hi,

Is something like this possible in C? I want to read an input file then allocate these arrays inside a structure. For each input file the number of surfaces, volumes, etc... will change.

struct geometry {
  int n_surfs;
  int n_vols;
  float surface_properties[n_surfs][10];
  float materials[n_mats][6];
  float cross_sections[n_isotopes][5];
  int surface_by_volume[n_vols][n_surfs];
  int material_by_volume[n_vols];
  ...
};

I only want to use an much shared memory as I need.

Brandon
<<

Dan Negrut

Global Moderator
Global Moderator

Posts: 833

Joined: Wed Sep 03, 2008 12:24 pm

Unread post Thu Dec 11, 2008 9:56 am

Re: variable-sized array inside of a structure

Brandon - per our discussion, i hope that the constant memory idea worked.
dan

Return to ME964 Fall 2008: High Performance Computing

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.