linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to prototype functions that return pointers
@ 2005-06-24 21:25 James Colannino
       [not found] ` <op.ssv8s2eyizdgzp@mail.nairnconsulting.ca>
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: James Colannino @ 2005-06-24 21:25 UTC (permalink / raw)
  To: linux-c-programming

Ok, so this is a very embarassing question.  I tried googling for the
answer but haven't figured it out yet, and everything I've tried results
in compilation errors. I want to prototype a function that takes nothing
as an argument but returns a pointer to a character.

I've tried the following:

char * readline();
char *readline();

These first two result in 4 errors, each one identical and each one
telling me "error: two or more data types in declaration of 'readline' "

*char readline();
* char readline();

These second two result in "error: syntax error before 'char' "

I know this should be so simple, but I can't for the life of me figure
this out.  Thanks very much in advance.

James
-- 
My blog: http://www.crazydrclaw.com/
My homepage: http://james.colannino.org/

" Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety." --Benjamin Franklin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-26  3:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-24 21:25 How to prototype functions that return pointers James Colannino
     [not found] ` <op.ssv8s2eyizdgzp@mail.nairnconsulting.ca>
2005-06-24 21:50   ` James Colannino
2005-06-25  6:22     ` wwp
2005-06-25  6:56 ` Steve Graegert
2005-06-26  3:36 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).