• 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
Newbie C Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie C Questions


  • Subject: Newbie C Questions
  • From: Tom McKenna <email@hidden>
  • Date: Tue, 29 Jan 2002 22:05:22 -0500

Originally I planned on teaching myself Cocoa from the "Learning Cocoa" book. Since my programming experience is limited to Commodore Basic, I found the book to be somewhat over my head. (OK, way over my head...)

I then decided to learn C, since Objective-C is ANSI C plus all of the object-oriented material. Since I was able to get a beginner's book on C, it has been much easier to learn.

Here are my questions (finally):

* When I am using Project Builder and I want to create a simple C application, what kind of project should I be opening? (I have been using the 'Standard Tool' option in PB...)

* Once I finish this book on C, I would like to learn Objective-C. Is there a beginner's book that doesn't work under the assumption that you know C++ or Java? If not, what should I do next?

* One of my tutorial apps compiles fine in PB, but it won't run in PB. It does run perfectly in the Terminal. Am I doing something wrong? Here's the code:

#include <stdio.h>

/* Filename: Avg.C */
/* Computes the average of three class grades */

main ()
{
float gr1, gr2, gr3;
float avg;

// Asks for each student's grade
printf("What grade did the first student get? ");
scanf(" %f", &gr1);
printf("What grade did the second student get? ");
scanf(" %f", &gr2);
printf("What grade did the third student get? ");
scanf(" %f", &gr3);

// Calculates the average of the three student's grades
avg = (gr1 + gr2 + gr3) / 3.0;
printf("\nThe student average is %.2f", avg);
return 0;
}

Thanks for any and all help, advice you can offer!

Sincerely,
Tom McKenna


  • Follow-Ups:
    • Re: Newbie C Questions
      • From: Ondra Cada <email@hidden>
    • Re: Newbie C Questions
      • From: "Daniel E. White" <email@hidden>
    • Re: Newbie C Questions
      • From: Christopher B Hamlin <email@hidden>
    • Re: Newbie C Questions
      • From: Bob Savage <email@hidden>
    • Re: Newbie C Questions
      • From: Ben Sayer <email@hidden>
    • Re: Newbie C Questions
      • From: Ross Hayden <email@hidden>
  • Prev by Date: Re: status bar
  • Next by Date: OpenGL
  • Previous by thread: Re: Control tints
  • Next by thread: Re: Newbie C Questions
  • Index(es):
    • Date
    • Thread