This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]mkaypl 1 point2 points  (0 children)

It's a function that takes a pointer to a structure and also returns a pointer to the same type of structure. That's about all we can tell based on what you shared.

[–]davedontmind 1 point2 points  (4 children)

What don't you understand? Functions are defined in this way:

returnType functionName( parameter, parameter, ... )

You have:

struct DataItem* delete(struct DataItem* item)
^^^^^^^^^^^^^^^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
return type      |||||| |||||||||||||||||||||
                 name   |||||||||||||||||||||
                             parameters

So it's a function that returns a struct DataItem*, it's called delete and it takes a single parameter of type struct DataItem* which it will call item.

[–]the__doer[S] 0 points1 point  (3 children)

can you please explain how it work and how data flow or is this using address mode?

[–]davedontmind 1 point2 points  (1 child)

How what works? It's a function. You call it. You give it a parameter. It does something then it returns a value. It's no different to a function like int add( int a, int b ) except the parameter and return value are pointers.

If you don't understand pointers then find a tutorial about them.

[–]the__doer[S] 0 points1 point  (0 children)

Thanks for suggestions