Amazon.com Widgets No Previous prototype for function
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 21, 2013, 11:47:36 AM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Old Stuff
| |-+  Chapter Study
| | |-+  Chapter 13 - Underlying C Language Features
| | | |-+  No Previous prototype for function
Pages: [1]   Go Down
Print
Author Topic: No Previous prototype for function  (Read 1206 times)
Darkel
Newbie
*
Posts: 1






« on: December 01, 2011, 08:01:14 PM »

I entered and ran program 13.4.  Curiously I got the warning message "No previous prototype for function".  The program ran fine but the warning was there.

After a little searching on the internet  someone suggested I simply define a function prototype at the top of my file as such:

void calculateTriangularNumber (int n);

// Function to calculate the nth triangular number

void calculateTriangularNumber (int n)
{
 blah blah blah
}

and so on.

This made the error go away.

Why?
Logged
bright
Newbie
*
Posts: 7







« Reply #1 on: December 31, 2011, 10:31:52 AM »

I think it is similar to a method declaration in the interface section which declares the method and ends with a semicolon whereas the implementation of the method does not end with a semicolon and has open and closed curly braces.
Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.