Confused by the commentS

#ifndef __ASGN3_H__
#define __ASGN3_H__

#include <iostream>
#include <string>

using namespace std;

#define MAX_ELEMENTS 10

class StringSet {
public:

// To store the strings
string elements[MAX_ELEMENTS];

// Represent the number of elements in the set
int size;

// Default constructor
// It initialzes the set to represent an empty set
StringSet() { zero();
// TODO: Implement this constructor
}

void zero() {
for (int i = 0; i <= size; i++)
elements[i] = 0;

}




/**
bool add(string &value);

Description:
Add @value to the set provided @value does not yet exist in the set
and the set is not yet full.

Parameter:
value: A string to be added to the set.

Return:
false: If @value cannot be added to the set because the set is full.
true: If @value already exists in the set or @value has been
successfully added to the set.
*/
bool add(string value) {


//(i wanna do it but i was really confused by the comment.)


// TODO: Implement this method
return false; // Replace this line if necessary
}
Last edited on
By "@value", they mean the string called "value" you are passing to the function.
Also, prefer const to #define
i don't know how to convert the message to c++ code. could you help me? thx
Just make the function do what the description tells you to. It's very explicit.
thx all of you, i get it , you are so helpful.
Topic archived. No new replies allowed.