I'm new to C++ programming and am writing a program to implement an insertion sort in an array. I decided to test out my printArray function before proceeding and keep getting a link error:
"MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup"
Here's the code(it's all in one .cpp file):
I have absolutely no idea what's causing this. I've checked my code over and over and just can't figure out the cause of the link error.Code://main.cpp #include <iostream> #include <iomanip> using namespace std; //Function to print out contents of array void printArray(const int a[], const int size); int main(int argc, char* argv[]) { const int arraySize = 10; int data[arraySize] = {34, 56, 4, 10, 77, 51, 93, 30, 5, 52}; //Print out contents of usorted Array cout << "Unsorted array:\n"; printArray(data, arraySize); cout << endl; return 0; } //Function to print out contents of array void printArray(const int a[], const int size) { for(int i = 0; i < size; i++) cout << setw(5) << a[i]; }




Reply With Quote
