This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

variable not know in current context

 
Steven Zoraster
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Why am I getting "variable not known in current context" for x in the following code:

float x = 0.0f;
for(int i=0;i<dataIn.length;i++){
x = (float)dataIn[0][i];
float y = (float)dataIn[1][i];
float z = (float)dataIn[2][i];
boolean b = distanceTransform(M,
Gf,dzdx,dzdy,grad,x,y,z);
}

Netbeans documentation says to initialize a variable before using it should cure this problem
 
Stevens Miller
Bartender
Pie
Posts: 992
10
C++ Java Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steven Zoraster wrote:Why am I getting "variable not known in current context" for x in the following code:


Gonna need a little more of that context to be of any help. Can you post the class and method definitions that include this fragment (assuming they're not too long, of course)?

Netbeans documentation says to initialize a variable before using it should cure this problem

If anything, I'd expect that to generate a "The assigned value is never used" warning, rather than solve anything.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic