By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,919 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

Any simple way to write this function

P: n/a
int type(int a)
{
return 0;
}
thanks a lot!

Mar 9 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a

<po***********@gmail.comwrote in message
news:11**********************@8g2000cwh.googlegrou ps.com...
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
Mar 9 '07 #2

P: n/a
po***********@gmail.com wrote:
int type(int a)
{
return 0;
}
Put '0' wherever you would call that function;-)

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Mar 9 '07 #3

P: n/a
po***********@gmail.com writes:
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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 9 '07 #4

P: n/a

<po***********@gmail.comwrote in message
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.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Mar 9 '07 #5

P: n/a
Jens Thoms Toerring wrote:
po***********@gmail.com wrote:
>int type(int a)
{
return 0;
}

Put '0' wherever you would call that function;-)
Surely '\0' or 0. The '0' character wouldn't be right.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Mar 10 '07 #6

P: n/a
po***********@gmail.com wrote:
>
int type(int a)
{
return 0;
}

thanks a lot!
#define type(a) 0

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 10 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.