Anonymous
Ehm, no
so what is the difference between the two different delcarations?
Anonymous
Anonymous
well you need them if you don't want "undefined function" warnings
"Undefined function" is a compilation error, isn't it?
Anonymous
Return value type
so since n is a pointer, you have declare the function as node *create ()
Alexander
note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf' warning: implicitly declaring library function 'vsnprintf' with type 'int (char *, unsigned long, const char *, struct __va_list_tag *)' [-Wimplicit-function-declaration]
Anonymous
so the pointer lives in the stack but hold the value to the memory address that is stored in the heap in this case ?
Alexander
why would you remove it ?
it's a long story, like I said I need to define them manually, without #includes
Anonymous
Anonymous
In this case yes
what happens to memory on the stack during runtime?
Anonymous
what happens to memory on the stack during runtime?
A stack is a special area of computer's memory which stores temporary variables created by a function. In stack, variables are declared, stored and initialized during runtime. It is a temporary storage memory. When the computing task is complete, the memory of the variable will be automatically erased
Anonymous
It returns one The function is not a pointer
That’s why, in C, function names are also pointer variables. When you create a function called go_to_warp_speed(int speed), you are also creating a pointer variable called go_to_warp_speed that contains the address of the function.
Anonymous
something i found in a book
Rostin
something i found in a book
Has nothing to do with your question
Anonymous
Has nothing to do with your question
they are saying function names are pointers variables that point to the location in memory where the memory is located right?
Rostin
U asked about the difference between int* func() and int func()
Anonymous
so a function like find() , find is a pointer to the functions location in memory?
Rostin
Function name is the same in both cases
Anonymous
Rostin
They have the same function name
Anonymous
They have the same function name
whats the significants of the *
Rostin
It signifies that return type is a pointer of type int
Anonymous
like int *somefunction(), or int somefunction(), or int ** somefunction()?
Rostin
Has nothing to do with the function name / function pointer
Rostin
Those are just different return types
Rostin
The position of "*" is interchangeable that's why you might get confused I guess
Anonymous
Those are just different return types
so returns an int, one returns an int pointer, and one returns an pointer, pointing to another pointer ?
Rostin
Yes that is correct
Anonymous
Yes that is correct
i think i understand now , thanks
Anonymous
Yes that is correct
one question , why would you point to another pointer , and why would you return that in a function?
Rostin
Some people are weird. Just because u can do something, doesn't mean u should
Anonymous
so int **p , is a pointer that point to another pointer, which that other pointer , points some some memory address of a variable
Rostin
U can do int *****p
Anonymous
Some people are weird. Just because u can do something, doesn't mean u should
lol i just see it in code , so i want to be able to understand what i am reading lol
I_Interface
U can do int *****p
What the hell...
Rostin
🙃🙃🙃🙃
I_Interface
U can do int *****p
Don't do it, ever...
Rostin
Sergey back to my point
Anonymous
What the hell...
recursive pointer
Rostin
Some people are weird. Just because u can do something, doesn't mean u should
Rostin
Much love <3
Anonymous
Much love <3
love is eternal
Anonymous
Much love <3
char ** it says they use to point to an array of strings , technically is an character array of arrays
Anonymous
Hey guys , looking for someone who knows how to program to telegram application will give more details at the private messages
Ilya
what happens to memory on the stack during runtime?
Actually, nothing happens. And that is truth
Ilya
they are saying function names are pointers variables that point to the location in memory where the memory is located right?
Function name literal also called identifier is a constant of type "pointer to function with there corresponding signature".
Ilya
like int *somefunction(), or int somefunction(), or int ** somefunction()?
These are not "like", but "unlikely"
Ilya
so returns an int, one returns an int pointer, and one returns an pointer, pointing to another pointer ?
But this cannot be in C and C++, same function cannot return three different types. Either this or that or third.
Ilya
U can do int *****p
No you can't.
Anonymous
It is a variable
I mean that it points to memory, not a variable
Ilya
Don't do it, ever...
Yes, if this happens, you must fix your keyboard urgently.
olli
No you can't.
why can't you do int ****p; ?
Ilya
why can't you do int ****p; ?
Because you must check and fix your keyboard first, or further will be worse!
olli
Function name literal also called identifier is a constant of type "pointer to function with there corresponding signature".
where is this defined? / does this come from? I strongly believe this is not true. If this would be the case, how would the compiler be able to detect and warn if a function type is used as operand of sizeof ? and further, why should it be ill-formed. it is true that in many cases a function designator implicitely converts to a function pointer. In the below example, foo is a function type and not a pointer to function void foo() {} src: n1570, 6.5.3.4#1, 6.3.2.1#9
binary
Hi Guys. Please, how can I read hex value (e.g. 0E 7F) from a file and easily convert the value to binary (e.g. 111001111111)? in C++
Рома
Hello)) Please help me. I want to print n! whith the recursion
klimi
okay
klimi
i can help you with that
Рома
ohh) thanks
klimi
so basicaly you want to recursively ask for the lower value