Connecting Tech Pros Worldwide Forums | Help | Site Map

Any simple way to write this function

poison.summer@gmail.com
Guest
 
Posts: n/a
#1: Mar 9 '07
int type(int a)
{
return 0;
}


thanks a lot!


Mike Wahler
Guest
 
Posts: n/a
#2: Mar 9 '07

re: Any simple way to write this function



<poison.summer@gmail.comwrote in message
news:1173470360.225685.305250@8g2000cwh.googlegrou ps.com...
Quote:
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


Jens Thoms Toerring
Guest
 
Posts: n/a
#3: Mar 9 '07

re: Any simple way to write this function


poison.summer@gmail.com wrote:
Quote:
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
Keith Thompson
Guest
 
Posts: n/a
#4: Mar 9 '07

re: Any simple way to write this function


poison.summer@gmail.com writes:
Quote:
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) kst-u@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"
Malcolm McLean
Guest
 
Posts: n/a
#5: Mar 9 '07

re: Any simple way to write this function



<poison.summer@gmail.comwrote in message
Quote:
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

Joe Wright
Guest
 
Posts: n/a
#6: Mar 10 '07

re: Any simple way to write this function


Jens Thoms Toerring wrote:
Quote:
poison.summer@gmail.com wrote:
Quote:
>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 ---
CBFalconer
Guest
 
Posts: n/a
#7: Mar 10 '07

re: Any simple way to write this function


poison.summer@gmail.com wrote:
Quote:
>
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

Closed Thread