Connecting Tech Pros Worldwide Forums | Help | Site Map

define string class which implements linked list at backend

saurabh
Guest
 
Posts: n/a
#1: Jul 22 '05
solve a problem:

define a Class(MyClassSArray a, b, c) which implements an array of string.
But, in the backend it is actually implementing Linked List, so that memory
is dynamically allocated.

eg: i can define like
a[10000] = "hello";
a[100] = b[100];,
printf(c[100]);

Howard
Guest
 
Posts: n/a
#2: Jul 22 '05

re: define string class which implements linked list at backend



"saurabh" <saurabh_ag2000@yahoo.com> wrote in message
news:485e0e3a.0405050709.45ace1a6@posting.google.c om...[color=blue]
> solve a problem:
>
> define a Class(MyClassSArray a, b, c) which implements an array of string.
> But, in the backend it is actually implementing Linked List, so that[/color]
memory[color=blue]
> is dynamically allocated.
>
> eg: i can define like
> a[10000] = "hello";
> a[100] = b[100];,
> printf(c[100]);[/color]

Sure, no problem. How about giving me your prof's email address, and I'll
send it there directly? Just $499, this week only.


Oystein Haare
Guest
 
Posts: n/a
#3: Jul 22 '05

re: define string class which implements linked list at backend


On Wed, 05 May 2004 08:09:14 -0700, saurabh wrote:
[color=blue]
> solve a problem:
>
> define a Class(MyClassSArray a, b, c) which implements an array of string.
> But, in the backend it is actually implementing Linked List, so that memory
> is dynamically allocated.
>
> eg: i can define like
> a[10000] = "hello";
> a[100] = b[100];,
> printf(c[100]);[/color]

#include <iostream>
#include <vector>
#include <string>

std::vector<std::string> blah;
blah.push_back("Hello");
blah.push_back("World");

std::cout << blah[0] << " " << blah[1] << std::endl;
Closed Thread