• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: conditional if..else
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conditional if..else


  • Subject: Re: conditional if..else
  • From: "Clark Cox" <email@hidden>
  • Date: Tue, 17 Jul 2007 12:01:38 -0700

On 7/17/07, Frank Murray <email@hidden> wrote:
Hello,

This is a new post, and I am relatively new to the XCode IDE.

As others have already pointed out, this is a basic C FAQ. The comp.lang.c newsgroup is a good place for questions like this, as long as you can tolerate the, at times, harsh regulars there :).

fjm

#include <stdio.h>

int main (int argc, const char * argv[]) {
    char scale[12];


printf ("Enter the temperature scale you're coming from, either Celcius or fahrenheit.\n"); scanf ("%s", &scale);

However, I have to add that using scanf like this is asking for trouble (e.g. what happens if the user enters more than 11 characters?). Read up on the fgets function; when used properly, it can protect you from issues like this.

--
Clark S. Cox III
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: conditional if..else
      • From: "Martin Redington" <email@hidden>
References: 
 >conditional if..else (From: Frank Murray <email@hidden>)

  • Prev by Date: Re: conditional if..else
  • Next by Date: Re: conditional if..else
  • Previous by thread: Re: conditional if..else
  • Next by thread: Re: conditional if..else
  • Index(es):
    • Date
    • Thread