Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner Help please... 1

Status
Not open for further replies.

BillyCoff

Technical User
Nov 26, 2004
1
AU
Hello

Excuse me for being such a beginner…

Just starting to teach myself C++ and am using Microsoft Visual C++.Net Step by Step manual. Following the project in the book I have come up against a problem I cannot seem to solve myself. It is very basic(!) so here goes:

//Investment Planner

#include "stdafx.h"

#using <mscorlib.dll>

using namespace System;
void DisplayWelcome();
void DisplayProjectedValue(double amount, int years, double rate);
double GetInvestmentAmount();
int GetInvestmentPeriod(int min=10, int max=25);


int _tmain();
void DisplayWelcome()
{
Console::WriteLine(S"-------------------------------------------");
Console::WriteLine(
S"Welcome to your friendly Investment Planner");
Console::WriteLine(S"-------------------------------------------");
return;
}

I am getting an error :
LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

Since I am such a beginner the Help file isn’t helping me. What fundamental part am I failing to grasp? Please put me out of my misery…any help gratefully received.

Thanks

BillyCoff
 
> int _tmain();
You don't have a main() function

Code:
int main ( ) {
    DisplayWelcome();   // call your function
    return 0;           // success!
}

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top