Any simple way to write this function

M

Mike Wahler

int type(int a)
{
return 0;
}

int type(void)
{
return 0;
}


More simple still: omit the function and
replace any calls to it with a literal zero.


-Mike
 
K

Keith Thompson

int type(int a)
{
return 0;
}


thanks a lot!

The subject header says "Any simple way to write this function".
Please include your question in the body of your article.

I'd use a text editor, probably nvi or vim, but any text editor will
do nicely. Apparently you've already figured out how to write the
function, so I don't know what you're asking.

If you meant to ask how to write a function that does something more
than the one you've posted, you'll have to be more specific. Your
choice of the name "type" is *almost* suggestive of what you're trying
to do, but I decline to guess. If you want a meaningful answer,
you'll need to ask a meaningful question.
 
M

Malcolm McLean

int type(int a)
{
return 0;
}


thanks a lot!

seems simple enough to me.
You can omit the first int for an implicit integer function. This is a left
over from the pre-prototype era of C. You could also omit the int a and then
the function will take any number of arguments, including the integer that
you want, though you don't use it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top