This question already has answers here:
getting free unit number in fortran
(2 answers)
Closed 7 years ago.
I can write a FORTRAN function to find an available file unit, but I was certain there was already an intrinsic. But if there is, I can't find anything about it. Is there such a thing or am I dreaming?
UPDATE: Apologies for the duplicate. Did a search, but it didn't show up.
I guess, you are looking for newunit (available with F2008, shown at the bottom of that link in the Fortran Wiki).
Ups, has already been answered.
maybe you were thinking of inquire?
Related
This question already has answers here:
Is there an interpreter for C? [closed]
(13 answers)
Closed 7 years ago.
I'm not looking for csh, I'm looking for a shell for C similar to the Python or the Scala shells.
I understand that C is a compiled language, but is there anything out there that would let me quickly play around with things so I can e.g. better learn how pointers work? It should at least be theoretically possible to do this, wondering if anyone has taken the time to implement it.
As you well know that C is a compiled language. It is better to write C code than compile it, do some breakpoints, learn what value is in memory, where the pointer points etc.
But I think you mean this. Is there an interpreter for C?
This question already has answers here:
"register" keyword in C?
(19 answers)
Closed 8 years ago.
I was reading some gstreamer code and fell on this line
register int i;
Does anyone know what the register keyword does ?
Another SO question has already answered this.
Answer From Brian Knoblauch:
It's a hint to the compiler that the variable will be heavily used and
that you recommend it be kept in a processor register if possible.
Most modern compilers do that automatically, and are better at picking
them than us humans. :-)
So, essentially, it assures the programmer that the compiler will know that the variable will be utilized numerous times and to keep that variable in the CPU register. As stated in the other answer, most compilers do this automatically.
This question already has answers here:
How is the square root function implemented? [closed]
(15 answers)
Closed 8 years ago.
How does sqrt function really work ? Does it go by any logical theorem to get the result.
Is there any way i can access the code of libarary function such as sqrt?
You can download the source code from the libc, which is open source: http://www.gnu.org/software/libc/download.html
This question already has answers here:
How does C compute sin() and other math functions?
(22 answers)
Closed 9 years ago.
Anybody can explain or show how is the function "sin" (or "sinf", "sinl") realized in C.
Intuition suggests that it should be somewhere in the math.h but I did not see anything there
There's a couple ways I can think of right off the bat:
Lookup tables
Approximation via Taylor series (which can be easily made accurate to a number of significant digits).
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
C equivalent of C++ STL
I am writing a program in C due to memory constraints on an embedded system. I need a std::unordered_set<int> to implement my algorithm. What STL-like libraries exist for C? If there isn't one which implements std::unordered_set<int> then what container can I use as an alternative?
sglib red black tree container seems to provide what I need.