Now I don't know much about Xcode
IDE but i am learning to use it and also learning c++
trying out a c++ function prototyping
example and get the error link command failed with error code 1
tried googling it and mostly found references to specific development environment like say ipadmini, iOX
etc.
Why this error after running other c++ codes
on Xcode without issues.
Here is the code I am using just in case I am doing it wrong:
//
// main.cpp
// c-test3
//
// Created by george on 04/07/2016.
// Copyright © 2016 george. All rights reserved.
// Demonstrates the use of function prototypes
//
typedef unsigned short USHORT;
#include <iostream>
using namespace std;
USHORT FindArea(USHORT length, USHORT width); //function prototype
int main(int argc, const char * argv[]) {
// insert code here...
USHORT lengthOfYard;
USHORT widthOfYard;
USHORT areaOfYard;
cout << "\nHow wide is your yard? ";
cin >> widthOfYard;
cout << "\nHow long is your yard> ";
cin >> lengthOfYard;
areaOfYard = FindArea(lengthOfYard, widthOfYard);
cout << "\nYour yard is ";
cout << areaOfYard;
cout << " square feet\n\n";
return 0;
}