Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: I need help |
| Date | 2011-05-14 10:59 -0700 |
| Organization | None to speak of |
| Message-ID | <lnwrhtgo45.fsf@nuthaus.mib.org> (permalink) |
| References | <e279cb75-8a72-4ad9-9877-62a9ca1b0dfe@glegroupsg2000goo.googlegroups.com> <iqm332$vm8$1@dont-email.me> |
Eric Sosman <esosman@ieee-dot-org.invalid> writes:
> On 5/14/2011 9:02 AM, janus wrote:
>> Thanks you all.
>>
>> However, I have additional question ..
>>
>> Is this acceptable?
>> char string[] = "Simulated Annealing = 857747716";
>> char astring[] = "Karmarkar 625874153";
>>
>> char * value = strchr(astring ,'=');
>> char * avalue;
>>
>> if(value != NULL){
>
> Since `value' will be NULL, this part is not executed.
That's true for this program, but this is probably an early
draft of a program that will later get its input from elsewhere.
Checking whether strchr() actually found the character you're
looking for is a good habit.
[snip]
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: I need help janus <emekamicro@gmail.com> - 2011-05-14 06:02 -0700
Re: I need help pete <pfiland@mindspring.com> - 2011-05-14 10:01 -0400
Re: I need help Columbus sailed the ocean China Blue <chine.bleu@yahoo.com> - 2011-05-14 07:03 -0700
Re: I need help Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-05-14 10:19 -0400
Re: I need help Keith Thompson <kst-u@mib.org> - 2011-05-14 10:59 -0700
csiph-web