define string class which implements linked list at backend

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • saurabh

    define string class which implements linked list at backend

    solve a problem:

    define a Class(MyClassSA rray 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

    #2
    Re: define string class which implements linked list at backend


    "saurabh" <saurabh_ag2000 @yahoo.com> wrote in message
    news:485e0e3a.0 405050709.45ace 1a6@posting.goo gle.com...[color=blue]
    > solve a problem:
    >
    > define a Class(MyClassSA rray 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.


    Comment

    • Oystein Haare

      #3
      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(MyClassSA rray 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;

      Comment

      Working...