• 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: help with calling a standard line app from terminal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with calling a standard line app from terminal


  • Subject: Re: help with calling a standard line app from terminal
  • From: Michael <email@hidden>
  • Date: Tue, 2 Sep 2008 19:58:16 -0700



On Sep 2, 2008, at 7:48 PM, Clark Cox wrote:
What do you need to know this for?

Fristly, thank you for answering.

It's an exercise in K&R  ( C programming language)  (p 153) showing how to use input/output in C.

So, if a program called "upper" is called, the code is this.

>>>

#include <stdio.h>
#include <ctype.h>
#include <string.h>

int main (int argc, const char * argv[]) {
    int c;
if (strcmp(argv[0], "upper")==0)   
   while ( (c = getchar() ) != EOF)
   putchar(toupper(c));
else
putchar(tolower(c));
return 0;
}
<<<<<<<

Using Xcode (3.1), I am trying to call this from the terminal, but not having too much success.  And, the exercises will be a lot more fun if I can actually get them to work!!!


 _______________________________________________
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: help with calling a standard line app from terminal
      • From: Michael <email@hidden>
References: 
 >help with calling a standard line app from terminal (From: Michael <email@hidden>)
 >Re: help with calling a standard line app from terminal (From: "Clark Cox" <email@hidden>)

  • Prev by Date: Re: help with calling a standard line app from terminal
  • Next by Date: Re: help with calling a standard line app from terminal
  • Previous by thread: Re: help with calling a standard line app from terminal
  • Next by thread: Re: help with calling a standard line app from terminal
  • Index(es):
    • Date
    • Thread