Question: I have a problem with my code in localhost, i use wampserver.

I did not find the error and the solution.

The error is as follows:

> 
> Notice: Undefined offset: 0 in C:\wamp\www\Test.php on line 74
> 
> 
> 

```
$html = curl_exec($ch);
[...]
preg_match_all("(<title>(.*)<\/title>)siU", $html, $title);
$metas = get_meta_tags($url, 1);
/* Line 74 */ $title = $title[1][0];
$titulo = html_entity_decode("$title", ENT_QUOTES, 'UTF-8');
$descripcion = isset($metas["description"])?$metas["description"] : '';
$keywords = isset($metas["keywords"])?$metas["keywords"] : '';  

```

How they could solve??

Greetings and thanks!

Answer: 
If you are using C arrays:

```
struct A { int v; }
A data[10];

void func(A *array, size_t n) {
}

func(data, 10);

```

Or if you are using a vector:

```
std::vector<A> vec;

void func(std::vector<A>& array) {
}

func(vec);

```
Since you are tagging this as "C++", I assume you are using vectors ( :-) )

```
void f1 ( yourVector& yourVector )
{
  // do something with the vector as read-write (for example fill the vector with somthing).
}

void f2 ( const yourVector& yourVector )
{
  // do something with the vector as read-only.
}

int main()
{
  std::vector <yourStruct> yourVector;
  f1( yourVector );
  f2( yourVector );
  return 0;
}

```