Here's the class
//Rolodex.h
//Declaration of class Rolodex
#ifndef ROLODEX_H
#define ROLODEX_H
#include <map>
#include <iterator>
Type: Posts; User: jackfraust
Here's the class
//Rolodex.h
//Declaration of class Rolodex
#ifndef ROLODEX_H
#define ROLODEX_H
#include <map>
#include <iterator>
here's what i should do:
//
#include <iterator>
#include "Rolodex.h"
#include <iostream>
Can somebody help me on this?
are these two function good?
list() function
void Rolodex::List()
{
std::ostream_iterator < string > output (cout, "\n");
std::copy( rolodex.begin(),...
I tried to create a new object to call the Add function but the compiler said that there is no default constructor available
void Rolodex::Add(Rolocard card)
{
string first, last, add, occ,...
I've got to create a rolodex with a container for cards which contains information.
I've already create the rolocard class which holds the information. Now my next step is to create the rolodex...
I'm trying to create a info manager like rolodex.
Rolodex.cpp
List() function
void Rolodex::List()
{
list<string>::iterator cIterator;
for (cIterator = cardlist.begin(); cIterator !=...
not to mention you can't just use them without initializing them.
how come i can't sort the mshape[i]->toString() in ascending order depending on the area?
for (int nStartIndex = 0; nStartIndex < number; nStartIndex++)
{
int nSmallestIndex =...
here is what i did.
shape* mshape[10];
int i, number;
cout << "CREATING SHAPE(circle, rectangle or square)\n\n" <<endl;
cout << "\nHow many shape you wish to create? " << endl;
How do you suppose i can store the shape* in an array and pring them all at one time with toString()
I did this but it craches
shape* mshape[10];
int i;
for ( i = 0; i < 2; ++i){
shape *shape_obj = getShape();
mshape[10] = shape_obj ;}
Can i sort toString by area like this?
for (i=0; i<10-1; i++)
for (j=i+1; j< 10; j++)
if (dshape[i]->area()>dshape[j])
{
temp=dshape[i];
dshape[i]=dshape[j];
nothing, its just that main.cpp doesn't recognize getShape(). It doesn't recognize, circle, square or rectangle either.
int main()
{
shape* dshape[10];
for ( int i = 0; i <...
I'm not talking about the getShape.cpp, i'm talking about shape and other derived classes, they shouldn't include getShape.cpp. ON the other hand, getShape.cpp is supposed to include circle.h,...
the source file shouldn't contain the implementation of getShape(). getshape is supposed to be the source file getShape.cpp and include the headers of circle.h, rectangle.h and square.h. Main.cpp is...
why is it that the compiler can't recognize the getShape() function.
this is the instruction for main:
The main.cpp file contains the main() function. It should define an array of base Shape pointers, and loops calling getShape() and storing the returned Shape...
It still doesn't work
here is what i wrote. I wrote again.
#include "Circle.h"
#include "Square.h"
#include "Rectangle.h"
That's the thing, the getShapte() function is suppose to get the dimensions from the input stream, then store them in an array. The getShape function is supposed to be in getShape.cpp. Then the main...
It doesnt work. It says that getShape(); is unidentified.
what i want to know is how do i run a program with function like Shape* getShape()??? That's what i really want to know.
what do you think is wrong with the program and how can i fix it?
when i say compiled i dont mean "work". It did compile without errors but the program doesn't run meaning there's a problem in the code. suppose the program is named shape.exe; I run shape.exe but...
I'm telling you it really did compiled for me and the terminal wouldn't display anything. But tell me, where do you think the error is?
it compiled in visual C++. How do you supposed i call the getShape function in main()?