wat is the difference b/w ponters and strings? :sad:

A ponter i don't no wat that is :sad:

A string is like a collection of chars

I hope this is helpful :cool:

A Pointer contains an address that points to data.
A string is any finite sequence of characters (i.e., letters, numerals, symbols and punctuation marks).

A string is any finite sequence of characters (i.e., letters, numerals, symbols and punctuation marks).

There are two types of strings -- C and C++.

A c-style string is a null-terminated sequence of characters -- certainly considerably less than infinite! That means that the string ends with the first byte that contains 0.

The C++ string is a class in std library. There are other c++ string classes too, but the standard one is in std namespace.

string ponter = new string;

Now we have a ponter that is a string :)

no its not -- it is still just a pointer, it just contains the address of a c++ class.

string ponter = new string;

Now we have a ponter that is a string :)

Sorry for dragging it...but its not even a valid code.

Shouldn't that be

string* ponter = new string;

:?:

Yup...though I have never seen or used it like this before.

Yup...though I have never seen or used it like this before.

I think it was meant to be a joke :rolleyes:
BTW jwenting is more of a java person, so perhaps that's where the confusion came from.

no its not -- it is still just a pointer, it just contains the address of a c++ class.

In the interest of not confusing the other poster, I'd like to point out that A.D. means 'address of an object [of type string]'.

wat is the difference b/w ponters and strings? :sad:

Mr. taha umer your Question is very simple POINTER is spacial type variable it is contane memory address. And it is move memory to memory location.
your 2nd Question is about array, ARRAY is continous block of memery in cpu. the relation of pointer and arrays is. the starting indux of array have a pointer.

This article has been dead for over six months. Start a new discussion instead.