Hi,
I have a question regarding the string array.
Here is the header file:
#include <iostream>
#include <string>
#define SIZE 100
using namespace std;
class bookmarks
{
private:
string url[SIZE];
string title[SIZE];
public:
bookmarks();
void setbookmarks(string& x[], string& y[]); //how should I set?
string getbookmarks();
};
Here is the implementation file:
#include <iostream>
#include "bookmarks.h"
#include <string>
#define SIZE 100
using namespace std;
bookmarks::bookmarks()
{
url[] = ""; //how should I set initialize all elements to be null?
title[] = "";
}
void bookmarks::setbookmarks(string& x[], string& y[])
{
url = x; //how should I set?
title = y;
}
string bookmarks::getbookmarks()
{
int i;
cout << " URL Page Title";
for (i = 0; i < SIZE; i++)
cout << url[i];
cout << " ";
cout << title[i];
cout << endl;
}
Thanks
gogo