From: Wolfgang Bangerth Date: Mon, 12 May 2008 21:38:47 +0000 (+0000) Subject: Properly initialize array. X-Git-Tag: v8.0.0~9150 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ca0dc5e84b473f7e1faed70de7b6f3b00be97e8;p=dealii.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,