Hi, I'm new to this programming stuff and I'm going through Beginner's Guide by Herbert Schildt. In Module 4 Critical Skill 4.1 Use one-dimensional array.

#include<iostream>
using namespace std;


int main()
{

    int sample[10];// this reserves 10 integer elements
int t;

// load the array
for(t=0; t<10; ++t) sample[t] = t;

// display the array
for (t=0; t<10; ++t)
cout << "This is sample[" << t << "]: " << sample[t] << "\n";

return 0;
}

ERRORS as follows:
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\Documents and Settings\Owner\My Documents\Visual Studio 2008\Projects\arrays\Debug\arrays.exe : fatal error LNK1120: 1 unresolved externals

When you set your project up, you want it to be a console application.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.