define string class which implements linked list at backend

S

saurabh

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]);
 
H

Howard

saurabh said:
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]);

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

Oystein Haare

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]);

#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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,137
Latest member
NoelAshwor
Top