hi

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2005
Posts: 5
Reputation: taha umar is an unknown quantity at this point 
Solved Threads: 0
taha umar taha umar is offline Offline
Newbie Poster

hi

 
0
  #1
Jan 31st, 2006
wat is the difference b/w ponters and strings?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: hi

 
0
  #2
Jan 31st, 2006
Originally Posted by taha umar
wat is the difference b/w ponters and strings?
A ponter i don't no wat that is

A string is like a collection of chars

I hope this is helpful
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: hi

 
0
  #3
Jan 31st, 2006
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).
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: hi

 
0
  #4
Jan 31st, 2006
  1. string ponter = new string;

Now we have a ponter that is a string
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,618
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1491
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: hi

 
0
  #5
Jan 31st, 2006
Originally Posted by sunnypalsingh
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,618
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1491
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: hi

 
0
  #6
Jan 31st, 2006
Originally Posted by jwenting
  1. 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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 421
Reputation: JoBe is on a distinguished road 
Solved Threads: 4
JoBe's Avatar
JoBe JoBe is offline Offline
Posting Pro in Training

Re: hi

 
0
  #7
Jan 31st, 2006
Originally Posted by jwenting
  1. string ponter = new string;
Shouldn't that be
  1. string* ponter = new string;
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: hi

 
0
  #8
Jan 31st, 2006
Originally Posted by jwenting
  1. string ponter = new string;

Now we have a ponter that is a string
Sorry for dragging it...but its not even a valid code.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: hi

 
0
  #9
Jan 31st, 2006
Originally Posted by JoBe
Shouldn't that be
  1. string* ponter = new string;
Yup...though I have never seen or used it like this before.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: hi

 
0
  #10
Jan 31st, 2006
Originally Posted by sunnypalsingh
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.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC