C++ :: Structure Record Type In Array - Unresolved Structures

Feb 25, 2015

Why I do have this error message?

1>------ Build started: Project: TMA04, Configuration: Debug Win32 ------
1>TMA04.obj : error LNK2019: unresolved external symbol "double __cdecl getFees(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?getFees@@YANV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
1>C:UsersEvgericDocumentsVisual Studio 2010ProjectsTMA04DebugTMA04.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

View 1 Replies


ADVERTISEMENT

C++ :: Structure Record Type In Array

Feb 24, 2015

I have to enter the Instructor ID and invokes getFees to find the fees of the given instructor. Then it will displays the message that shows either the fees or "No such instructor ID" if not found. the function prototype is

double.getProfessionFees(string);
#include <iostream>
using namespace std;
const int DECLARED_SIZE = 7;
int search(const int a[], int number_used, int target);
struct InstructorType

[Code]....

View 7 Replies View Related

C++ :: Data Structures - File Size Not Decreasing When Erase A Record

Nov 26, 2014

// my size is not decreasing when I erase a record.
//dvr_hwch.cpp

#include <iostream>
#include <iomanip>
#include <cassert>
using namespace std;
#include "hash_chn.h"
void print_menu( );

[Code] .....

View 1 Replies View Related

C/C++ :: Templated Data Structure - Error LNK2019 / Unresolved External Symbol

Mar 23, 2015

I am working on building a set of templated data structures for my own learning and have run in to an error when instantiating my templated linked list. I receive the following error:

error LNK2019: unresolved external symbol "public: __thiscall LinkedList<int>::~LinkedList<int>(void)" (??1?$LinkedList@H@@QAE@XZ) referenced in function _main

--LinkedList.h--
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
template<class T>
class LinkedList {

[code]....

why I would be receiving this error?

View 1 Replies View Related

C++ :: Storing File Data In Array With Structure Type?

Feb 20, 2015

I have a structure

struct Wine
{
string wineName;
int vintage;
int rating;
double price;
};

how can i store the file data below in an array with the structure type???

Dow Vintage Port ;2011;99;82
Mollydooker Shiraz Carnival of Love ;2012;95;75
Prats & Symington Douro Chryseia ;2011;97;55
Quinta do Vale Meão Douro ;2011;97;76
Leeuwin Chardonnay River Art Series ;2011;96;89

View 1 Replies View Related

C++ :: Template Class Type - Unresolved Link Errors

Jun 25, 2013

I'm getting unresolved link errors when I attempt to compile.

dNode.h

#ifndef DNODE_H
#define DNODE_H
template <class T>
class dNode {

[Code] ....

ERROR:
Error1error LNK2019: unresolved external symbol "public: __thiscall dStack<double>::dStack<double>(void)" (??0?$dStack@N@@QAE@XZ) referenced in function "void __cdecl stack_test(void)" (?stack_test@@YAXXZ)main.objprog09
Error2error LNK2019: unresolved external symbol "public: virtual __thiscall dStack<double>::~dStack<double>(void)" .......

View 3 Replies View Related

C/C++ :: How To Use One Structure Data In Other Structures

Jul 2, 2014

I created one structure and the created structure is using in few more structures, but i did not get the proper data.

typedef struct _MSG_HEADER{
//MESSAGE_HEADER 40 bytes
short iApiTcode;
short iApiFuncId;
int LogTime;
char AlphaChar[2];

[Code]...

My requirement is have to fill the MessageHeader structure & we can use that header in all the structures entire program.

View 3 Replies View Related

C++ :: Errors With Unresolved Token And Unresolved External Signal

Jul 10, 2013

My program will not run because of error LNK2028 "unresolved token" and error LNK2019 "unresolved external signal" and I do not know why. My teacher says that I need to make the constructor and display functions display class variables in different formats, but I do not know what to do with that. Here are my 3 files:

Header take 2.h:

#pragma once
#include <iostream>
#include <string>
using namespace std;
class Heading {
private:
string company, report;

[Code] ....

Here are the errors:
Error1error LNK2028: unresolved token (0A0003C9) "public: __thiscall Heading::Heading(void)" (??0Heading@@$$FQAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)c:UsersOwnerdocumentsvisual studio 2012ProjectsClassLibrary2ClassLibrary2Source1.objClassLibrary2

[Code] ....

View 2 Replies View Related

C++ :: Adding New Record To Array?

Feb 1, 2013

I'm having some issues with adding a record to my array.

#include <iostream>
#include <fstream>
#include <string>

[Code].....

View 2 Replies View Related

C++ :: Returning A Structure As Function Return Type

Apr 4, 2013

I am having problems with my function definition of a function that should return a structure value.

This is the error I get compute.cpp(9): error C2146: syntax error : missing ';' before identifier 's_advertisebus'

The error is on the line where I start my function definition typing my function type as a structure. A long time ago in c the keyword struct is used with the structure type like struct s_advertisebus s_readadbus(). I tried it both ways but I got errors.

// struct.h
#ifndef STRUCT_H
#define STRUCT_H

struct s_advertisebus {
int nnumberofads;
float fpercentused;

[Code] ....

View 2 Replies View Related

C/C++ :: How To Create Objects Of Same Data Structure (type)

Dec 31, 2014

well i create a State.h class

#ifndef STATE.H
#define STATE_H
class State {
public:
virtual void handle_action() = 0;
virtual void update() = 0;
virtual void render() = 0;
};
#endif //STATE.H

What i'm trying to create is a simple State Manager for SFML! I created another class that inherits State.

#pragma once
#include "state.h"
class FirstState : public State {
public:
FirstState();
~FirstState();
void handle_action();
void update();
void render();
};

So the question is this, each state that i have will inherit the State class. However, i wanted to perhaps add each state object into a vector array. But i'm not sure as to what data type it be? I have a state manager class that will contain the vector.

What i want to do is this, each game state will create an object that will inherit functions from the state.h class. I want to store them all in a vector array, but each object is clearly named different. My curiosity was wondering, since all those different states inherit the State.h class, can i simply create a State Object std::vector<State> *states; that will contain all those different state objects?

[URL]....

View 1 Replies View Related

C++ :: Deleting A Record From Struct Array?

Aug 31, 2014

I want to delete selected records from struct array using cstring reading from files. Here I read my records to stud struct then assign non-deleted to stu struct but its not deleting as desired...strcmp is giving 25

while(cont=='Y'){
cout<<"Enter student ID to delete: ";
cin.ignore();
cin.getline(id, 15,

[Code] ....

I did some debugging effort and I found here is the problem..the stud[0].ID and id is not same but why? I am giving in same id and both char array lenght is 15

while(cont=='Y'){
cout<<"Enter student ID to delete: ";
cin.ignore();
cin.getline(id, 15);
cout<<strlen(stud[0].ID)<<" "<<strlen(id)<<endl;///---> lenght 1 is 10
///---->lenght 2 is 8
cout<<strncmp(id,stud[0].ID, 10 )<<endl;

View 2 Replies View Related

C++ :: Create A Class Type Structure Using Struct Instead Of Classes

Apr 16, 2013

I am trying to create a class type structure using struct instead of classes.

Code:
#include <iostream>
#include <stdlib.h>
using namespace std;
struct myclass {
int * array;
int nelements;

[Code] ....

Guess what I am asking is using the pointer in the first code section better or is there another way'. I don't know about making the second code work.

View 3 Replies View Related

C++ :: Manipulate Array Of Student Record Objects

May 15, 2014

Create an application to manipulate an array of student record objects. A student record will consist of a name (first, middle, and last), an ID number (9 numeric digits, cannot be more or less), an address (street, city, state, and 5 digit Zip code), and a phone number (3 digit area code and 7 digit number). The application will support an array of students. The user will be allowed to enter records from the keyboard, sort records by either name (last, first, middle) or by ID, save the records to a disk file (name supplied by user), and read the records from a disk file (name again supplied by user).

Create a fixed length string that must check that the length of the string is the required length. The fixed length class should be done as a template with the number of characters as the template argument. From this fixed length string, derive a class to hold digits of a fixed length.

Create component classes as necessary to use together to implement the student record class.

Use either the array template created in an earlier lab to handle the array or you may use the vector class from the STL to handle the array of student record objects.

The maximum number of students will be 25 (it may be less).

View 1 Replies View Related

C++ :: Changing Array Of Numbers Of Type Char To Type Int?

Apr 27, 2013

I'm having some problems with changing an array of numbers of type char to type int. Every time i try to sum 2 array indexed values it returns some letter or symbol. Also, if i change the type of the array in the functions the compiler gives me an error message. I would also like to add that the problem requires that the first two arrays be char so each individual number gets assigned to a different value.

My current code is:

Code:
#include <iostream>
void input(char a[], char b[], int& size_a, int& size_b);
void convert(char a[], int size);
void reverse(char a[], int size);
void add(char a[], char b[], int c[], int size);
int main()

[Code]....

View 4 Replies View Related

C++ :: Convert Element Of Int Type Of Array To Char Type?

Dec 21, 2013

how to convert an element of int type of an array to char type?

View 2 Replies View Related

C :: Array Containing Pointers To Structures?

Aug 9, 2013

How do I store pointers to a struct in an array ? I am using sprintf to concatenate some values together and then output it to an array in its 1st argument. A portion of my code is shown below.

Code:

int count = 0;
struct addx {
int a;

[Code].....

View 1 Replies View Related

C :: Storing Array Of Structures

May 4, 2013

So i have a program with the structure

Code:

char record[20];
typedef struct{
int id;
char title[20];
char subject[20];
char faculty [20];
int level;
char fname[25];
}report;
int recno,i;
report list[100];

I need to store the hundred records into a file. What are the functions and elements i should use/introduce.

View 2 Replies View Related

C/C++ :: Initializing Array Of Structures

Feb 25, 2014

How to initialize this array of structures in my code

struct CustomerAddress; {
string street;
string city;
string state;
int zip;

[Code] ....

I am going to be using a boolean variable to mark whether or not a specific field has had data entered into it. I figure the best way to do that is to initialize all the elements of the structures to 0. However, with strings and with the nested structure, I'm not sure how to do this.

View 6 Replies View Related

C :: Reading File To Array Of Structures

Jun 9, 2013

I have to write a program that reads from a text file, which contains a list of stock hourly prices and the company names. Something like this:

78.52 82.56 75.10 71.97 Water Company
22.40 25.68 21.37 22.96 Mega Shipping Inc

There's suppose to one array of companies, where each company will be kept in a structure that contains: a pointer for the name, an array of the prices, and the average price for the day. The structures will be kept in an array of structures.

My question is, how do I read the data from the file and put the data from each line into the next structure in the array of structures? I read the numbers in fine. I just use:

Code: fscanf(fp, "%f", &companyAry[i].hourlyPrices[j]);

But my program crashes when I try to read the name.

Code: fscanf(fp, "%[^]", &companyAry[i].companyName);

I'm thinking it has something to do with the fact the companyName is a pointer.

My structure looks like this:

Code:

typedef struct {
char *companyName;
float hourlyPrices[NUM_PRICES];
float avgPrice;
}
COMPANY;

View 8 Replies View Related

C :: How To Find Duplicates In Array Of Structures

Jul 21, 2014

I have an array of structures with structure def that looks like.

Code:
struct {
char * name;
char * school;
int age;
}

there are multiple people with same name but different ages so i want to list them like.

Name.
age 1
age 2 and so on

The array is sorted by name already.

View 3 Replies View Related

C++ :: Read In Name Of A Vendor Into Array Of Structures

Feb 26, 2013

so im trying to read in the name of a vendor into an array of structures. and write the name into a file.

#include <iostream>
#include <cstring>
#include <cctype>
#include <fstream>
using namespace std;
struct booth

[code]....

View 5 Replies View Related

C++ :: How To Delete Elements In Array Of Structures

Apr 4, 2013

Any example to delete an element in an array of structure?Is it same as deleting an element in an array.ie like this....???

// to delete an element in an array
#include<iostream.h>
#include<conio.h> // for clrscr() and getch()
void main() {
clrscr();
int a[50],n,t,index,i;

[Code] .....

View 1 Replies View Related

C/C++ :: How To Add Info To Array Of Nested Structures

Dec 4, 2014

I am making a basic music library that stores information rather than files. I need to read from a .txt file the artist's name, the album name, the song name, and the song length. What I am confused about is storing the information in an array of Artist structures.

struct Song{
string songName;
int songLength;
};
struct Album{

[Code] ...

How to read the information into an array of Artists. Also, how would I be able to figure out if the artist already exists in the array when adding a song and if the artist does, add the album under the existing artist.This is how I am reading in the info:

Artist newArtist;
Album newAlbum;
Song newSong;
ifstream inF("library.txt");
while(!inF.eof()) {

[Code] ....

View 1 Replies View Related

C/C++ :: Using (delete) Operator On Array Of Structures?

Feb 27, 2013

Suppose I have the following structure

struct b
{
char fullname[100];
char title[100];
bopname
};

and i declare a pointer to the struct as follows

b* bp;

and at runtime,

bp = new b[5];

In the end, is the statement delete[ ] bp enough to release the dynamically allocated memory. Or do i need to separately delete bp[0],bp[1]...

Does delete[ ] bp indicate that the array[ ] pointed by bp has to be deleted?? [I am confused as to how this happens, since the pointer only points at the 1st struct address]

View 2 Replies View Related

C/C++ :: How To Initialize Array Of Structures At Runtime

Aug 26, 2014

I somewhere read "You cannot initialize a structure like that at run time."

Example:
struct item_info {
      char itemname[15];
      int quantity;
      float retail;
      float wholesale;

[Code] ....

But if you want to assign values at run time then you have to do it manually like:

strcpy(item[0].itemname, "rice");
item[0].quantity = 10;
item[0].retail = 40;
item[0].wholesale = 30;

I tried in internet but am unable to know the differences. I want to know the difference between those two in terms of run time and compile time. Explanation required also for below one. Is this run time or compile time? How does we actually decide which is run time and which is compile time!

struct item_info {
      char itemname[15];
      int quantity;
      float retail;
      float wholesale;
      //int quatityonorder;

[Code] ....

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved