sizeof(function_name) [duplicate] - c

This question already has answers here:
What does 'sizeof (function name)' return?
(4 answers)
Closed 10 years ago.
I tried sizeof(printf) , sizeof(foobar) etc. where foobar is a user defined function. It returns 1 without any warning or error. Why 1?

The size of functions is not well defined in C, so the value is meaningless.

Related

How can I use pow function in kernel space? [duplicate]

This question already has answers here:
2 to the power of N in C without pow
(2 answers)
The most efficient way to implement an integer based power function pow(int, int)
(21 answers)
Closed 1 year ago.
I want to do a pretty simple calculation: 2^20, but I don't have the library math.h.
How can I do it in the kernel space?

Using a dot for variable declaration in C [duplicate]

This question already has answers here:
What is the meaning of a dot (.) after an integer in c?
(2 answers)
Closed 2 years ago.
I read a code online and the next line caught my attention since I don't know why does it have a "." after the 0:
variable=0.;
I couldn't find the answer after looking for it. Could you please tell me what is the dot for?
Thanks!!
The dot makes it a double. A clearer way to write it is 0.0.

How is memory organized inside a stack frame? [duplicate]

This question already has answers here:
Explain the concept of a stack frame in a nutshell
(6 answers)
What is an application binary interface (ABI)?
(17 answers)
Closed 2 years ago.
Speaking of the order of parameters, return addresses, local variables and other block statements, how are they pushed inside the stack frame and how that particular order works? I'm having a bit of trouble understanding this concept.

what is the use of 'return 0' in C [duplicate]

This question already has answers here:
What is the purpose of the returning of a value from main() in C/C++? [duplicate]
(5 answers)
Closed 7 years ago.
Why do we have to use 'return 0' statement in C?
in the end of main function. I know This means all things are going on way. But what does it mean? What exactly are there at the background of this ?
It returns a number to the environment that started it... Every process begins with a set of arguments and returns an int indicating success or failure
see So what does "return 0" actually mean?
Potentially, a calling process can read the result and use it as information on what the execution of the program did.

Sqrt function working in c [duplicate]

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

Resources