|
[Sponsors] |
April 6, 2010, 11:39 |
Convert int to char
|
#1 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Hello world.
I haven't found a way of converting an int value to a char-string. Is that possible with FLUENT UDF's?! sega
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
April 6, 2010, 12:28 |
|
#2 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 20 |
Try to use sprintf.
Example: char a[100]; sprintf(a,"%d",1002); ------------------------------------------------- Now you should have in "a" 1002 as a string. I didn't actually test my above code, so you can expect to have some problems adapting this to a UDF. Do |
|
April 7, 2010, 16:04 |
|
#3 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Thank you! sprintf() was the right approach!
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM-1.5-dev svn revision 1438: libOpenFOAM does not compile in SP | 4xF | OpenFOAM Bugs | 3 | October 16, 2009 06:35 |
Error with Wmake | skabilan | OpenFOAM Installation | 3 | July 28, 2009 01:35 |
Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 12:48 |
Statically Compiling OpenFOAM Issues | herzfeldd | OpenFOAM Installation | 21 | January 6, 2009 10:38 |
int to char in UDF | Paolo Lampitella | FLUENT | 3 | December 11, 2008 05:01 |