Mail Archives: djgpp/2001/12/20/19:48:31
On Tue, 18 Dec 2001 12:05:51 -0800 (PST), Chris Amos
<homie_dont_play_dat AT yahoo DOT com> wrote:
>
>void getstr(const char *string, const char *new_string, int
>start_offset, int end_offset);
>
Iam a newbe, so I may get somethings wrong.
Why declare the function then, define it, just have the function above
main.
>
>/**************************************************************************/
>void getstr(const char *string, const char *new_string, int
>start_offset, int end_offset)
>
Does declaring a const .... make the parameter readonly (ie
unchangable)???
>
>{
> int i=0;
> int b=0;
>
> for (i=start_offset; i<=end_offset; i++) {
> *(new_string+b)=string+i;
> b++;
> }
> *(new_string+b)='\0';
> return;
>
Syntax of return is return exp;
The function is declared to return void (ie it does not return
anything), so no need of return anyway.
Just my Aus 2 cents...
- Raw text -