Re: First program in C - what is going on with function returns?
- From: ben.carbery@xxxxxxxxx
- Date: 30 Apr 2006 05:02:11 -0700
Thanks for the detailed response!
speakdate(int d, int m, int y)
What type is being returned? If you meant "nothing", specify void.
As per last reply, I want to return a string, but am not sure of the
syntax for returning arrays...
if (fmod(year,4)==0) {
At a guess, you simply want the modulus operand - % - here.
so... "if((year%4)==0)" ?
int main(void)
on a related note, is there a difference between "int main (void)" and
"int main ()" ?
speakdate(), as written, returns nothing, so treating it as if it does is
an error. That you get any output at all is simply a matter of accident.
should be able to fix this if i can return an array.
there's no way this could be the full code, as it cannot compile.
Hmmm, this was the full code I was using, compiling ok with bloodshed
dev-c++ on windows (a gcc based compiler). Can't see anything obvious
to raise the logging level, or to expert stricter code...
.
- Follow-Ups:
- Re: First program in C - what is going on with function returns?
- From: Herbert Rosenau
- Re: First program in C - what is going on with function returns?
- From: Bill Pursell
- Re: First program in C - what is going on with function returns?
- References:
- First program in C - what is going on with function returns?
- From: ben . carbery
- Re: First program in C - what is going on with function returns?
- From: Kelsey Bjarnason
- First program in C - what is going on with function returns?
- Prev by Date: Re: help me learn C
- Next by Date: Re: Casting void * to void ** ?
- Previous by thread: Re: First program in C - what is going on with function returns?
- Next by thread: Re: First program in C - what is going on with function returns?
- Index(es):
Relevant Pages
|