473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

explain a prototype of function

82
Hello!!!
I have to write a function and they are giving me the prototype of the function, but i don't understand what arguments takes.
the prototype is:
Expand|Select|Wrap|Line Numbers
  1. coroutine *co_start(void (*body) (void*), void *attr);
can you explain me what arguments take this function and what returns?
I am really confused.
Sep 30 '08 #1
3 1630
sicarie
4,677 Expert Mod 4TB
Can you post your best guess to that? I would recommend breaking it down into parts:

1) what does the function return?
2) what are parameters passed?
3) what types are the parameters being passed?

You can also google search for help.
Sep 30 '08 #2
kalar
82
coroutine *co_start(void (*body) (void*), void *attr);

coroutine *co_start . This means that i should make a function co_start that returns a pointer to coroutine.

void (*body) (void*) is one of the arguments of the function.This argument is a pointer to a function body.This function takes as argument a pointer to void.

the second argument void *attr of the function co_start is a pointer to void.
Right???
Oct 1 '08 #3
JosAH
11,448 Expert 8TB
coroutine *co_start(void (*body) (void*), void *attr);

coroutine *co_start . This means that i should make a function co_start that returns a pointer to coroutine.

void (*body) (void*) is one of the arguments of the function.This argument is a pointer to a function body.This function takes as argument a pointer to void.
... and that function returns nothing (void).

the second argument void *attr of the function co_start is a pointer to void.
Right???
Right.

kind regards,

Jos
Oct 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Daniel Nichols | last post by:
I've noticed that in a C module (.c, .h file combination) that if you create a function's definition before it is used in other functions than a declaration is not necessary. I believe if the...
13
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
6
by: dennis.sprengers | last post by:
I am writing my own WYSIWYG editor. For inserting URL's, images, etc. I am not using html popups, but invisible DIV's of which I set the visibility to "visible" whenever I need them. Below are...
6
by: burningodzilla | last post by:
Hi all - I'm preparing to dive in to more complex application development using javascript, and among other things, I'm having a hard time wrapping my head around an issues regarding "inheritance"...
3
by: Robert | last post by:
Hi, I thought I pretty much understood the whole prototype chain stuff, but now I stumbled upon a difference between IE and Firefox, that is totally confusing me. An example.......
2
oll3i
by: oll3i | last post by:
function myClass(modul,var1,var2,var3,var4,var5,var6,var7,var8,domainURL){ this.modul=modul; this.var1=var1; this.var2=var2; this.var3=var3; this.var4=var4; this.var5=var5; this.var6=var6;...
21
by: globalrev | last post by:
i have a rough understanding of lambda but so far only have found use for it once(in tkinter when passing lambda as an argument i could circumvent some tricky stuff). what is the point of the...
2
by: hzgt9b | last post by:
I know how to overwrite a function. Normally this is what I would do: function someFunction() { /* orig definition here */ } //later in the execution stream I would do... someFunction = function...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.