From: bangerth Date: Mon, 12 May 2008 21:38:47 +0000 (+0000) Subject: Properly initialize array. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=275a2b4b181d7f09b025ef61b063d74df7c8afdb;p=dealii-svn.git Properly initialize array. git-svn-id: https://svn.dealii.org/trunk@16086 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-33/step-33.cc b/deal.II/examples/step-33/step-33.cc index 75167f12b9..e02d932901 100644 --- a/deal.II/examples/step-33/step-33.cc +++ b/deal.II/examples/step-33/step-33.cc @@ -1817,12 +1817,13 @@ void ConsLaw::load_parameters(const char *infile){ // Initial conditions. prm.enter_subsection("initial condition"); { - std::vector expressions; + std::vector expressions (EulerEquations::n_components, + "0.0"); for (unsigned int di = 0; di < EulerEquations::n_components; di++) { char var[512]; std::sprintf(var, "w_%d value", di); - expressions.push_back (prm.get(var)); + expressions[di] = prm.get(var); } initial_conditions.initialize (FunctionParser::default_variable_names(), expressions,