whether "abc"[0] in standard C
From: ccwork (ccwork_at_hotmail.com)
Date: 02/28/05
- Next message: Walter Roberson: "Re: calling my custom function same as library function"
- Previous message: Richard Bos: "Re: Help With Strings"
- Next in thread: Chris Dollin: "Re: whether "abc"[0] in standard C"
- Reply: Chris Dollin: "Re: whether "abc"[0] in standard C"
- Reply: Serve Lau: "Re: whether "abc"[0] in standard C"
- Reply: Krishanu Debnath: "Re: whether "abc"[0] in standard C"
- Reply: Clark S. Cox III: "Re: whether "abc"[0] in standard C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Feb 2005 01:18:15 -0800
Hi all,
I found some people writing code as:
/****************** sample code ********************/
int ans;
...
printf("%c\n", " yn"[ans]);
/***************** sample code end *****************/
The value of variable "ans" will be an index to print ' ', 'y' or
'n'. Is this a syntax " yn"[ans] in standard C?
- Next message: Walter Roberson: "Re: calling my custom function same as library function"
- Previous message: Richard Bos: "Re: Help With Strings"
- Next in thread: Chris Dollin: "Re: whether "abc"[0] in standard C"
- Reply: Chris Dollin: "Re: whether "abc"[0] in standard C"
- Reply: Serve Lau: "Re: whether "abc"[0] in standard C"
- Reply: Krishanu Debnath: "Re: whether "abc"[0] in standard C"
- Reply: Clark S. Cox III: "Re: whether "abc"[0] in standard C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|