Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,110 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,114 people online right now. Registration is fast and FREE... Join Now!




struct, init(...)

 
Reply to this topicStart new topic

struct, init(...), LNK 2019 & LNK 1120 Error

caelum21
post 7 Oct, 2008 - 03:32 PM
Post #1


New D.I.C Head

*
Joined: 7 Oct, 2008
Posts: 2



Thanked 1 times
My Contributions


#include<iostream>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<string>

using namespace std;
struct VoltageSource {
string name;
double volts;
double amps;
double watts;
double rating_watts;
double avg_watts;
};

struct Resistor {
string name;
double volts;
double amps;
double watts;
double ohms;
double rating_watts;
};

struct LoadResistor {
string name;
double volts;
double amps;
double watts;
double avg_watts;
double ohms;
double lower_ohms;
double upper_ohms;
double min_volts;
int low_voltage_event;
};

struct LoadCurrent {
string name;
double volts;
double amps;
double watts;
};

VoltageSource init( string name,
double volts,
double rating_watts,
double avg_watts);

Resistor init( string name,
double ohms,
double rating_watts );

LoadResistor init( string name,
double lower_ohms,
double upper_ohms,
double min_volts,
double avg_watts);

LoadCurrent init( string name,
double amps = 10.0 );

int event_counter();
void print(VoltageSource VS);

int main(void){

VoltageSource VS = init("VS", 100.0, 1000.0, 0.0);

cout << VS.name << endl;


return 0;
}


// Why do I get the LNK Errors after compiling this code?

This post has been edited by caelum21: 7 Oct, 2008 - 03:47 PM
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/21/08 09:53AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month