CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Variable outside brackets? (https://www.cfd-online.com/Forums/openfoam-programming-development/67259-variable-outside-brackets.html)

sega August 10, 2009 03:04

Variable outside brackets?
 
Hello World.

I'm sure this is a C++ related question.

I created a variable inside a bracked {} and I'm filling it with content in it..
Code:

  {
      scalarField myVariable;
      ...
  }

What I want to do is to have access to this variable outside of the bracket!

Do you know how this can be done?!

henrik August 10, 2009 03:06

Dear Sega,

define it outside, not inside.

Henrik

sega August 10, 2009 03:11

And I can access the variable inside the bracket if defined outside?!

henrik August 10, 2009 03:27

Dear Sebastian,

of course. Have a look at icoFoam. p is defined outside of the PISO-loop, but used within.

Henrik


All times are GMT -4. The time now is 01:59.