CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Should I learn C or C++? (http://www.cfd-online.com/Forums/fluent/33494-should-i-learn-c-c.html)

Kim April 16, 2004 07:15

Should I learn C or C++?
 
Hi, everyone. I am now struggling with UDFs hardly. Although I habe already learned C++, I habe many problems. So, I want to learn repeatedly C or C++ language. Should I learn C or C++? What is better for both cases, to compile UDF and to interpret UDF?

thomas April 16, 2004 09:16

Re: Should I learn C or C++?
 
Hi, For me writing UDF is not a question of learning C or C++. Learning C or C++ will allow you to avoid error of syntax but will never teach you how to build a correct UDF. What you need to write correct UDF is to know how to write correct algorithm (which independant from the language used) and also know in advance what fluent macro you need to get the right variable. Certain people might tell you that you need to know the notion of pointer, and thus learn C or C++. Well my advice is if you just need to use C or C++ for Fluent coding, you should spend more time on the notion of domain and thread rather that pointer. So to conclude I am sure the solution of all your problems are in the Fluent documentation which also give you the basic C/C++ syntax you need.

Hope this will give you furtehr ideas. Thomas

ap April 16, 2004 18:09

Re: Should I learn C or C++?
 
To learn C++ you need to know C, so C and then, if you want C++.

Also, to write UDF you should have some basis of C, while C++ is usable only in compiled UDF.

A good C guide has been written by J. Purdum, but you can find a lot of documentation on the Internet.

Hi :)

ap


All times are GMT -4. The time now is 23:39.