Re: c question
- From: Nils Philippsen <nils wombat dialup fht-esslingen de>
- To: Tom Gilbert <gilbertt tomgilbert freeserve co uk>
- cc: Chris Jones <chris black-sun co uk>, Gnome Devel <gnome-devel-list gnome org>
- Subject: Re: c question
- Date: Fri, 1 Oct 1999 16:17:30 +0200 (CEST)
On Fri, 1 Oct 1999, Tom Gilbert wrote:
> This is the right solution though :)
>
> I like:
>
OK, my ideas on this (they boil down to: "Who needs to strdup() it
anyway"):
void function (const char *in_string)
^^^^^
> {
> if( string == NULL ) {
> string = "default";
> }
>
> /* ... */
>
> }
>
> int main()
> {
> function( "moo" );
> function( NULL );
> }
>
Nils
--
Nils Philippsen / Vogelsangstrasse 115 / D-70197 Stuttgart / +49.711.6599405
nils@wombat.dialup.fht-esslingen.de / nils@fht-esslingen.de / nils@redhat.de
The use of COBOL cripples the mind; its teaching should, therefore, be
regarded as a criminal offence. -- Edsger W. Dijkstra
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]