Hi, found this forum after searchin around the web tryin to figure out what my error messages meant.
Trying to follow a beginners guide to objective c, using Xcode
I made a new project under application - command line tool
Im tryin to make a simple function that i can call, just to do a basic maths calculation.
Spent hours trying to figure out what im doing wrong, but googlin error messages kinda brings up documentation with all sorts of tech speak
Ive copied my code below - it doesnt copy the error messages so ive typed them manually with **** around them
Sorry for being so dim, i could program pretty well in BASIC on my Atari ST, but guess things have moved on a bit! Im trying the easiest guide i can find, but i cant even get the second program running :-(
Any help really appreciated. Is my definition of the function in the wrong place? Again, sorry for being a bit dim.
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
float circleradius =5;
float result;
result = circlearea(circleradius); ****error implicit declaration of function 'circlearea'****
return 0;
}
float circlearea(float wibble)
{ ****error conflicting types for 'circlearea'****
float thearea;
thearea = 3.14 * wibble * wibble;
return thearea;
}
Trying to follow a beginners guide to objective c, using Xcode
I made a new project under application - command line tool
Im tryin to make a simple function that i can call, just to do a basic maths calculation.
Spent hours trying to figure out what im doing wrong, but googlin error messages kinda brings up documentation with all sorts of tech speak
Ive copied my code below - it doesnt copy the error messages so ive typed them manually with **** around them
Sorry for being so dim, i could program pretty well in BASIC on my Atari ST, but guess things have moved on a bit! Im trying the easiest guide i can find, but i cant even get the second program running :-(
Any help really appreciated. Is my definition of the function in the wrong place? Again, sorry for being a bit dim.
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
float circleradius =5;
float result;
result = circlearea(circleradius); ****error implicit declaration of function 'circlearea'****
return 0;
}
float circlearea(float wibble)
{ ****error conflicting types for 'circlearea'****
float thearea;
thearea = 3.14 * wibble * wibble;
return thearea;
}