CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

for loop compile error

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2016, 06:59
Default for loop compile error
  #1
AHF
Member
 
AHF's Avatar
 
amirhossein
Join Date: Jul 2014
Location: Canada
Posts: 81
Rep Power: 11
AHF is on a distinguished road
Hi
can i use for loops in udf ?
like this :

for (int j = 10 ; j >= 0 ; j = j - 1)
{
.......;
}

errors :
error C2143: syntax error : missing ';' before 'type'
error C2143: syntax error : missing ')' before 'type'
error C2065: 'j' : undeclared identifier
warning C4552: '>=' : operator has no effect; expected operator with side-effect
__________________
amirhosseinfardi94@gmail.com
AHF is offline   Reply With Quote

Old   July 20, 2016, 07:17
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 12
Bruno Machado is on a distinguished road
Quote:
Originally Posted by AHF View Post
Hi
can i use for loops in udf ?
like this :

for (int j = 10 ; j >= 0 ; j = j - 1)
{
.......;
}

errors :
error C2143: syntax error : missing ';' before 'type'
error C2143: syntax error : missing ')' before 'type'
error C2065: 'j' : undeclared identifier
warning C4552: '>=' : operator has no effect; expected operator with side-effect
i'd define j as a global variable and create an if like

if (j >= 0)
{
...
j--;
}
Bruno Machado is offline   Reply With Quote

Reply

Tags
compile a udf, fluent, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 46 March 6, 2022 13:21
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 62 September 18, 2017 06:45
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 04:30.